Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030361Ab3E3J4i (ORCPT ); Thu, 30 May 2013 05:56:38 -0400 Received: from intranet.asianux.com ([58.214.24.6]:12483 "EHLO intranet.asianux.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967560Ab3E3J4Z (ORCPT ); Thu, 30 May 2013 05:56:25 -0400 X-Spam-Score: -100.8 Message-ID: <51A72215.5060500@asianux.com> Date: Thu, 30 May 2013 17:55:33 +0800 From: Chen Gang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: edumazet@google.com, Pravin Shelar , mgorman@suse.de CC: David Miller , Andrew Morton , "linux-kernel@vger.kernel.org" , netdev Subject: Re: [PATCH] include/linux/skbuff.h: using '0xffff' instead of '~0U' References: <51A6EBC5.7040601@asianux.com> In-Reply-To: <51A6EBC5.7040601@asianux.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1741 Lines: 58 It seems a good idea to "fgrep -rn '~0U'" all source code, and check each one by one. :-) On 05/30/2013 02:03 PM, Chen Gang wrote: > > Both 'transport_header' and 'mac_header' are u16, which are never equal > to '~0U'. > > So need use '0xffff' instead of '~0U'. > > The related warning (with EXTRA_CFLAGS=-W ARCH=m68k for allmodconfig) > include/linux/skbuff.h:1587:2: warning: comparison is always true due to limited range of data type [-Wtype-limits] > ... > > > Signed-off-by: Chen Gang > --- > include/linux/skbuff.h | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h > index 2e0ced1..03ba058 100644 > --- a/include/linux/skbuff.h > +++ b/include/linux/skbuff.h > @@ -1581,7 +1581,7 @@ static inline void skb_set_inner_mac_header(struct sk_buff *skb, > } > static inline bool skb_transport_header_was_set(const struct sk_buff *skb) > { > - return skb->transport_header != ~0U; > + return skb->transport_header != 0xffff; > } > > static inline unsigned char *skb_transport_header(const struct sk_buff *skb) > @@ -1624,7 +1624,7 @@ static inline unsigned char *skb_mac_header(const struct sk_buff *skb) > > static inline int skb_mac_header_was_set(const struct sk_buff *skb) > { > - return skb->mac_header != ~0U; > + return skb->mac_header != 0xffff; > } > > static inline void skb_reset_mac_header(struct sk_buff *skb) > -- Chen Gang Asianux Corporation -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/