From: Julian Wiedmann <jwi@linux.ibm.com>
To: David Miller <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>
Cc: netdev <netdev@vger.kernel.org>,
linux-s390 <linux-s390@vger.kernel.org>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
Ursula Braun <ubraun@linux.ibm.com>,
Karsten Graul <kgraul@linux.ibm.com>,
Julian Wiedmann <jwi@linux.ibm.com>
Subject: [PATCH net-next 3/5] net/af_iucv: replace open-coded U16_MAX
Date: Tue, 19 May 2020 21:10:10 +0200 [thread overview]
Message-ID: <20200519191012.65438-4-jwi@linux.ibm.com> (raw)
In-Reply-To: <20200519191012.65438-1-jwi@linux.ibm.com>
Improve the readability of a range check.
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
---
net/iucv/af_iucv.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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;
--
2.17.1
next prev parent reply other threads:[~2020-05-19 19:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-19 19:10 [PATCH net-next 0/5] net/iucv: updates 2020-05-19 Julian Wiedmann
2020-05-19 19:10 ` [PATCH net-next 1/5] net/iucv: remove pm support Julian Wiedmann
2020-05-19 19:10 ` [PATCH net-next 2/5] net/af_iucv: " Julian Wiedmann
2020-05-19 19:10 ` Julian Wiedmann [this message]
2020-05-19 19:10 ` [PATCH net-next 4/5] net/af_iucv: remove a redundant zero initialization Julian Wiedmann
2020-05-19 19:10 ` [PATCH net-next 5/5] net/af_iucv: clean up function prototypes Julian Wiedmann
2020-05-19 19:50 ` [PATCH net-next 0/5] net/iucv: updates 2020-05-19 David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200519191012.65438-4-jwi@linux.ibm.com \
--to=jwi@linux.ibm.com \
--cc=davem@davemloft.net \
--cc=heiko.carstens@de.ibm.com \
--cc=kgraul@linux.ibm.com \
--cc=kuba@kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=ubraun@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).