提交 0d1c7664 编写于 作者: J Julian Wiedmann 提交者: David S. Miller

net/af_iucv: replace open-coded U16_MAX

Improve the readability of a range check.
Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 585bc220
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册