diff options
author | Julian Wiedmann <jwi@linux.ibm.com> | 2020-05-19 22:10:10 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-05-19 22:50:14 +0300 |
commit | 0d1c7664ed2044048d5ed790b943affa296bc3a4 (patch) | |
tree | c2dd9f14cc0c44b45afcb230d48e6728fd098dfa /net/iucv/af_iucv.c | |
parent | 585bc2209539501674b77de68f58e98039892501 (diff) | |
download | linux-0d1c7664ed2044048d5ed790b943affa296bc3a4.tar.xz |
net/af_iucv: replace open-coded U16_MAX
Improve the readability of a range check.
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/iucv/af_iucv.c')
-rw-r--r-- | net/iucv/af_iucv.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c index 84bd18fea1d6..b02470a04c50 100644 --- a/net/iucv/af_iucv.c +++ b/net/iucv/af_iucv.c @@ -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> @@ -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; |