Optimize the less-than-zero check in netif_msg_init.  And, the type of
the default_msg_enable_bits argument should match netif_msg_init's
return type.

Signed-off-by: Chuck Lever <chuck.le...@oracle.com>
---

 include/linux/netdevice.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index a9db4f3..a501f03 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2356,10 +2356,10 @@ enum {
 #define netif_msg_hw(p)                ((p)->msg_enable & NETIF_MSG_HW)
 #define netif_msg_wol(p)       ((p)->msg_enable & NETIF_MSG_WOL)
 
-static inline u32 netif_msg_init(int debug_value, int default_msg_enable_bits)
+static inline u32 netif_msg_init(int debug_value, u32 default_msg_enable_bits)
 {
        /* use default */
-       if (debug_value < 0 || debug_value >= (sizeof(u32) * 8))
+       if ((size_t)debug_value >= (sizeof(u32) * 8))
                return default_msg_enable_bits;
        if (debug_value == 0)   /* no output */
                return 0;


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit 
http://communities.intel.com/community/wired

Reply via email to