Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753199AbbKZRAb (ORCPT ); Thu, 26 Nov 2015 12:00:31 -0500 Received: from smtprelay0131.hostedemail.com ([216.40.44.131]:42513 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751474AbbKZRA2 (ORCPT ); Thu, 26 Nov 2015 12:00:28 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,::::::::::::::::::,RULES_HIT:41:355:379:541:599:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2198:2199:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3867:3870:3871:3872:3874:4321:4605:5007:6261:7875:7903:10004:10400:10848:11026:11232:11233:11473:11658:11914:12048:12296:12517:12519:12740:13069:13095:13138:13163:13229:13231:13255:13311:13357:14659:21080:21088:30054:30070:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: song33_20c759c6cf91e X-Filterd-Recvd-Size: 2478 Message-ID: <1448557223.18647.4.camel@perches.com> Subject: Re: [PATCH] staging: net: core: skbuff.c: Added do-while pair for complex macros From: Joe Perches To: Jitendra Kumar Khasdev , davem@davemloft.net, edumazet@google.com, alexander.h.duyck@redhat.com, linus.luessing@c0d3.bluen, hannes@stressinduktion.org, willemb@google.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jitendra Kumar Khasdev Date: Thu, 26 Nov 2015 09:00:23 -0800 In-Reply-To: <1448555763-5088-1-git-send-email-jitendra.khasdev@hotwaxsystems.com> References: <1448555763-5088-1-git-send-email-jitendra.khasdev@hotwaxsystems.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.16.5-1ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1605 Lines: 45 On Thu, 2015-11-26 at 22:06 +0530, Jitendra Kumar Khasdev wrote: > This patch is to file skbuff.c that fixes up following error, > reported by checkpatch.pl tool, Your subject title is not correct. This is not a staging patch. > 1. ERROR: Macros with multiple statements should be enclosed > in a do - while loop. checkpatch is brainless. Not every message it emits needs fixing. > diff --git a/net/core/skbuff.c b/net/core/skbuff.c [] > @@ -748,11 +748,13 @@ void consume_skb(struct sk_buff *skb) > EXPORT_SYMBOL(consume_skb); > > /* Make sure a field is enclosed inside headers_start/headers_end section */ > -#define CHECK_SKB_FIELD(field) \ > - BUILD_BUG_ON(offsetof(struct sk_buff, field) < \ > - offsetof(struct sk_buff, headers_start)); \ > - BUILD_BUG_ON(offsetof(struct sk_buff, field) > \ > - offsetof(struct sk_buff, headers_end)); \ > +#define CHECK_SKB_FIELD(field) \ > + do { \ > + BUILD_BUG_ON(offsetof(struct sk_buff, field) < \ > + offsetof(struct sk_buff, headers_start)); \ > + BUILD_BUG_ON(offsetof(struct sk_buff, field) > \ > + offsetof(struct sk_buff, headers_end)); \ > + } while (0) \ Perhaps the last check should add a sizeof(field) BUILD_BUG_ON((offsetof(struct sk_buff, field) + FIELD_SIZEOF(struct sk_buff, field)) > offsetof(struct sk_buff, headers_end)); -- 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/