Skip to content

Commit

Permalink
net/af_iucv: replace open-coded U16_MAX
Browse files Browse the repository at this point in the history
Improve the readability of a range check.

Signed-off-by: Julian Wiedmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
julianwiedmann authored and davem330 committed May 19, 2020
1 parent 585bc22 commit 0d1c766
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/iucv/af_iucv.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/types.h>
#include <linux/limits.h>
#include <linux/list.h>
#include <linux/errno.h>
#include <linux/kernel.h>
Expand Down Expand Up @@ -1559,7 +1560,7 @@ static int iucv_sock_setsockopt(struct socket *sock, int level, int optname,
switch (sk->sk_state) {
case IUCV_OPEN:
case IUCV_BOUND:
if (val < 1 || val > (u16)(~0))
if (val < 1 || val > U16_MAX)
rc = -EINVAL;
else
iucv->msglimit = val;
Expand Down

0 comments on commit 0d1c766

Please sign in to comment.