diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2019-02-27 13:37:26 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-12-05 09:21:14 +0100 |
commit | 4ccab1788e9a37d9ebed05f4e306dc915bb6fba0 (patch) | |
tree | 41b24db93e3512d9d1aa8cfc4a506712435438d6 /include/linux | |
parent | b32dc79a5ac557d124fbc124b2d6d61bbc97bcf1 (diff) | |
download | linux-stable-4ccab1788e9a37d9ebed05f4e306dc915bb6fba0.tar.gz linux-stable-4ccab1788e9a37d9ebed05f4e306dc915bb6fba0.tar.bz2 linux-stable-4ccab1788e9a37d9ebed05f4e306dc915bb6fba0.zip |
net: dev: Use unsigned integer as an argument to left-shift
[ Upstream commit f4d7b3e23d259c44f1f1c39645450680fcd935d6 ]
1 << 31 is Undefined Behaviour according to the C standard.
Use U type modifier to avoid theoretical overflow.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/netdevice.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 8c2fec0bcb26..5ada5fd9652d 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -3790,7 +3790,7 @@ static inline u32 netif_msg_init(int debug_value, int default_msg_enable_bits) if (debug_value == 0) /* no output */ return 0; /* set low N bits */ - return (1 << debug_value) - 1; + return (1U << debug_value) - 1; } static inline void __netif_tx_lock(struct netdev_queue *txq, int cpu) |