Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752262AbdGDVId (ORCPT ); Tue, 4 Jul 2017 17:08:33 -0400 Received: from mout.gmx.net ([212.227.15.15]:49320 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752169AbdGDVIc (ORCPT ); Tue, 4 Jul 2017 17:08:32 -0400 Subject: Re: [BUG] checkpatch: false positive storage class location To: Joe Perches , Andy Whitcroft References: <20170704192901.23126-1-xypron.glpk@gmx.de> <1499201063.19466.2.camel@perches.com> Cc: linux-kernel@vger.kernel.org, u-boot@lists.denx.de From: Heinrich Schuchardt Message-ID: Date: Tue, 4 Jul 2017 23:08:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1499201063.19466.2.camel@perches.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:+33S/HtiyWBavuDevZrPiCF9M1zojcffUuGT1f3biyKu2NAPC7P plW4Hz35/RwV7EfWfBaXAgKDpdzZDwm3Ou0tRRdeWXq0q0snOHgFx7y6YbWgE5shDVSBFQi P/xXCsRjlZCC4+wGVAhwYoVy/INwSF8inHrNzFS72WLlu1GYKYdPyiLvJTH5Vw1jMBfA3CA b2pBYobTg/AM4z80kwe+Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:Lzxsy5OPz9s=:AygsJ66QXwgd2OKT38EHeP skZmzgJgX26GBvlEpqAXP7/R7PnnDwsL2kHPRQpKDqwN7CigNeIxcTrXWaBsMjdndQbilu44P yTSq+z6UhIginLA2w7cJ1SGWtCOMRot9evNk2c7ndXukd0TvV0gybwTGemovRDdHWDzNt4ay+ 3TRiDucVvvKT/veBjw2QWbsECOpl6kkyGRsGwNWrIBuNITUy28N3qhnzErKT/uupQvPNBTvfJ YzfFOAfEMp3nISG9WbppoorzeIw2AI53B7e/+PTs8KSoDOJqL/YkcFN2rYlO0XYg1HY+TQHR/ wdk3cxnQpFW0BEaqPdTfcXhMOFD902bllwSf3gKDRywH3eOoD4sjUMSrW4DBrBPTjBsTA1b+b 26B34WFwn8nTVNV4nWjOAykPdS1T/+jtvE8QJ/6vg9tBe0lr4r0BOqKGWUj/r98Ab29mwx+XU QBJ1go38OVHGHsBKvzxUdMTH2U4flXWcVkUzdSo+2AKeZMeuThAZE0DPtYqvNXLNM+SQc6aws OvbZ3iAPbCE/O0HrXBw3+rY7H9Wv5OBMt8C61AidYf4kfl3ew1sSbZrmhvtW2PnX0GRGzLonC 3P1nnhG9Ej3Eg8nkmSv7BgoIlTzZio7J7Ssaepc9uIGwd1BO4wwh+oTyms6NgLkrjAkJnsrKT Ct9OSKxinU/8hcrq+a7znCk2bCZE5e59wM6vtfuPlKohZcGJ7hrVBCG47uQyVAOkWB4iabeM7 hZOUTfP/dS4oi05iyiSNIzaQ9QI30HvZl0OGG5W13ETenTTMFZpTrMA8MCvhaTWHP2BiWPRVz 22+msBJ Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2584 Lines: 87 On 07/04/2017 10:44 PM, Joe Perches wrote: > 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 > Thank you. This works for all cases but +static ulong efi_do_enter(ulong asmlinkage (*entry)(void *image_handle, + struct efi_system_table *st)) +{ + return 0; +} + Here I get WARNING: space prohibited between function name and open parenthesis '(' where I would have expected WARNING: storage class should be at the beginning of the declaration Best regards Heinrich Schuchardt