Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751213AbdIOGBN (ORCPT ); Fri, 15 Sep 2017 02:01:13 -0400 Received: from smtprelay0172.hostedemail.com ([216.40.44.172]:58270 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751116AbdIOGBM (ORCPT ); Fri, 15 Sep 2017 02:01:12 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2197:2199:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3653:3868:3872:3874:4321:5007:10004:10400:10848:11232:11658:11914:12043:12555:12740:12760:12895:12986:13069:13255:13311:13357:13439:14181:14659:14721:21080:21221:21451:21627:30029:30030: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:11,LUA_SUMMARY:none X-HE-Tag: error64_27552617fec52 X-Filterd-Recvd-Size: 2142 Message-ID: <1505455268.27581.3.camel@perches.com> Subject: Re: [PATCH v2] checkpatch: support function pointers for unnamed function definition arguments From: Joe Perches To: Miles Chen , Andy Whitcroft , Andrew Morton Cc: linux-kernel@vger.kernel.org, wsd_upstream@mediatek.com, linux-mediatek@lists.infradead.org Date: Thu, 14 Sep 2017 23:01:08 -0700 In-Reply-To: <1505389925-31087-1-git-send-email-miles.chen@mediatek.com> References: <1505389925-31087-1-git-send-email-miles.chen@mediatek.com> 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: 1183 Lines: 30 On Thu, 2017-09-14 at 19:52 +0800, Miles Chen wrote: > Current unnamed function definition argument does not include function > pointer cases and it reports something like: > > WARNING: function definition argument 'void' should also have an identifier name > +unsigned int (*dummy)(void); > > Support function pointers for unnamed function arguments > > Signed-off-by: Miles Chen Acked-by: Joe Perches > --- > scripts/checkpatch.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > index dd2c262..03eb255 100755 > --- a/scripts/checkpatch.pl > +++ b/scripts/checkpatch.pl > @@ -5957,7 +5957,7 @@ sub process { > > # check for function declarations that have arguments without identifier names > if (defined $stat && > - $stat =~ /^.\s*(?:extern\s+)?$Type\s*$Ident\s*\(\s*([^{]+)\s*\)\s*;/s && > + $stat =~ /^.\s*(?:extern\s+)?$Type\s*(?:$Ident|\(\s*\*\s*$Ident\s*\))\s*\(\s*([^{]+)\s*\)\s*;/s && > $1 ne "void") { > my $args = trim($1); > while ($args =~ m/\s*($Type\s*(?:$Ident|\(\s*\*\s*$Ident?\s*\)\s*$balanced_parens)?)/g) {