projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2b3c688
)
net: dev: Use unsigned integer as an argument to left-shift
author
Andy Shevchenko
<andriy.shevchenko@linux.intel.com>
Wed, 27 Feb 2019 10:37:26 +0000
(13:37 +0300)
committer
David S. Miller
<davem@davemloft.net>
Wed, 27 Feb 2019 17:34:39 +0000
(09:34 -0800)
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>
include/linux/netdevice.h
patch
|
blob
|
history
diff --git
a/include/linux/netdevice.h
b/include/linux/netdevice.h
index 86dbb3e29139591d046602003cd7cb115f8b7e1a..848b54b7ec9146eac22265d56de2c44de2671d4b 100644
(file)
--- a/
include/linux/netdevice.h
+++ b/
include/linux/netdevice.h
@@
-3861,7
+3861,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 (1
U
<< debug_value) - 1;
}
static inline void __netif_tx_lock(struct netdev_queue *txq, int cpu)