From: Andy Shevchenko Date: Wed, 27 Feb 2019 10:37:26 +0000 (+0300) Subject: net: dev: Use unsigned integer as an argument to left-shift X-Git-Tag: v4.9.206~28 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6b2540ebc763fd76e7564e798e9ec2be97f769ae;p=platform%2Fkernel%2Flinux-amlogic.git 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 2ecf0f3..29ed597 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -3565,7 +3565,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)