Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752242AbdGDUo2 (ORCPT ); Tue, 4 Jul 2017 16:44:28 -0400 Received: from smtprelay0004.hostedemail.com ([216.40.44.4]:38190 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751960AbdGDUo1 (ORCPT ); Tue, 4 Jul 2017 16:44:27 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:69:355:379:541:599:800:960:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3353:3622:3653:3865:3866:3867:3870:3871:3872:3874:4250:4321:5007:7264:10004:10400:10848:11026:11232:11658:11914:12295:12555:12679:12740:12760:12895:13439:14181:14659:14664:14721:21080:21325:21433:21451:21627:30022:30025:30054:30070:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: honey49_9770b2641208 X-Filterd-Recvd-Size: 2874 Message-ID: <1499201063.19466.2.camel@perches.com> Subject: Re: [BUG] checkpatch: false positive storage class location From: Joe Perches To: Heinrich Schuchardt , Andy Whitcroft Cc: linux-kernel@vger.kernel.org, u-boot@lists.denx.de Date: Tue, 04 Jul 2017 13:44:23 -0700 In-Reply-To: <20170704192901.23126-1-xypron.glpk@gmx.de> References: <20170704192901.23126-1-xypron.glpk@gmx.de> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.6-1ubuntu1 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: 2031 Lines: 67 On Tue, 2017-07-04 at 21:29 +0200, Heinrich Schuchardt wrote: > The U-Boot project uses the same scripts/checkpatch.pl as the Linux > kernel. I ran upon the problem below when working on U-Boot. But I > guess it should be fixed in the Linux upstream. > > Running checkpatch for this email produces > WARNING: storage class should be at the beginning of the declaration > > This relates to the parameter with asmlinkage. > > asmlinkage is at the start of the parameter so I think this a false > positive. > > Signed-off-by: Heinrich.Schuchardt > --- > > cmd/bootefi.c | 22 +++++++++++++++++----- > 1 file changed, 17 insertions(+), 5 deletions(-) > > diff --git a/cmd/bootefi.c b/cmd/bootefi.c > index 771300ee94..4df468307c 100644 > --- a/cmd/bootefi.c > +++ b/cmd/bootefi.c > @@ -147,6 +147,12 @@ static void *copy_fdt(void *fdt) > return new_fdt; > } > > +static ulong efi_do_enter(void *image_handle, > + struct efi_system_table *st, asmlinkage ulong (*entry)( > + void *image_handle, struct efi_system_table *st)) > +{ > + return 0; > +} > + > /* > end > */ Perhaps this? ------------------------- Allow storage class after comma for function pointers. Miscellanea: o Add missing semicolon after WARN statement --- scripts/checkpatch.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 43171ed88115..c7490ab48ce1 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -5577,9 +5577,10 @@ sub process { } # Check that the storage class is at the beginning of a declaration - if ($line =~ /\b$Storage\b/ && $line !~ /^.\s*$Storage\b/) { + if ($line =~ /\b$Storage\b/ && + $line !~ /^.\s*(?:.*,\s*)?$Storage\b/) { WARN("STORAGE_CLASS", - "storage class should be at the beginning of the declaration\n" . $herecurr) + "storage class should be at the beginning of the declaration\n" . $herecurr); } # check the location of the inline attribute, that it is between