Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752331AbdFNNtP (ORCPT ); Wed, 14 Jun 2017 09:49:15 -0400 Received: from smtprelay0062.hostedemail.com ([216.40.44.62]:35340 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750728AbdFNNtO (ORCPT ); Wed, 14 Jun 2017 09:49:14 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:355:379:541:599:800:960:966:968:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1543:1593:1594:1711:1730:1747:1777:1792:1801:2196:2199:2393:2559:2562:2693:2828:3138:3139:3140:3141:3142:3354:3622:3653:3865:3866:3867:3868:3870:3871:3872:3873:3874:4321:4385:4605:5007:8957:9010:10004:10400:10848:11026:11232:11473:11658:11914:12043:12296:12555:12740:12760:12895:12986:13172:13229:13439:13618:14181:14659:14721:21080:21324:21451:21627:30029:30054: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: net82_1625b3c49ce4b X-Filterd-Recvd-Size: 4148 Message-ID: <1497448151.18751.53.camel@perches.com> Subject: Re: [PATCH v2] checkpatch: [HLP]LIST_HEAD is also declaration From: Joe Perches To: Steffen Maier , Andy Whitcroft , linux-kernel@vger.kernel.org Cc: linux-s390@vger.kernel.org Date: Wed, 14 Jun 2017 06:49:11 -0700 In-Reply-To: References: <1497437132.18751.45.camel@perches.com> <20170614133512.89425-1-maier@linux.vnet.ibm.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: 3167 Lines: 71 On Wed, 2017-06-14 at 15:43 +0200, Steffen Maier wrote: > Sorry, only realized after sending v2, that you also mentioned SLIST_HEAD, which I haven't found on git grep'ing include/ only. > > I could only find SLIST_HEAD (and even another variant) in some driver private header. > Am I searching in a wrong way? > If not, shall we still add this like the other official list APIs? No worries. checkpatch is not and never will be free of false-positives. I had done git grep -E "define\s+[A-Z]?LIST_HEAD" and listed the results but I wouldn't bother with SLIST_HEAD. It's private to one driver. > Linus' tree at: > $ git branch -vv > * master 63f700aab4c1 [origin/master] Merge tag 'xtensa-20170612' of git://github.com/jcmvbkbc/linux-xtensa > > $ git grep 'define.*LIST_HEAD(' > drivers/gpu/drm/nouveau/include/nvif/list.h:124:#define LIST_HEAD(name) \ > drivers/gpu/drm/radeon/mkregtable.c:47:#define LIST_HEAD(name) \ > drivers/scsi/aic7xxx/queue.h:107:#define SLIST_HEAD(name, type) \ > drivers/scsi/aic7xxx/queue.h:249:#define BSD_LIST_HEAD(name, type) \ > include/linux/list.h:22:#define LIST_HEAD(name) \ > include/linux/list.h:625:#define HLIST_HEAD(name) struct hlist_head name = { .first = NULL } > include/linux/list.h:626:#define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL) > include/linux/llist.h:75:#define LLIST_HEAD(name) struct llist_head name = LLIST_HEAD_INIT(name) > include/linux/plist.h:104:#define PLIST_HEAD(head) \ > include/linux/shm.h:57:#define shm_init_task(task) INIT_LIST_HEAD(&(task)->sysvshm.shm_clist) > scripts/kconfig/list.h:30:#define LIST_HEAD(name) \ > tools/include/linux/list.h:21:#define LIST_HEAD(name) \ > tools/include/linux/list.h:595:#define HLIST_HEAD(name) struct hlist_head name = { .first = NULL } > tools/include/linux/list.h:596:#define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL) > tools/usb/usbip/libsrc/list.h:24:#define LIST_HEAD(name) \ > > > On 06/14/2017 03:35 PM, Steffen Maier wrote: > > Fixes the following false warning > > among others for LLIST_HEAD and PLIST_HEAD: > > > > WARNING: Missing a blank line after declarations > > #71: FILE: drivers/s390/scsi/zfcp_fsf.c:422: > > + struct hlist_node *tmp; > > + HLIST_HEAD(remove_queue); > > > > Signed-off-by: Steffen Maier > > --- > > Changes from v1: > > Extended it to also support LLIST_HEAD and PLIST_HEAD as suggested 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 4b9569fa931b..86818b0ba8be 100755 > > --- a/scripts/checkpatch.pl > > +++ b/scripts/checkpatch.pl > > @@ -732,7 +732,7 @@ our $FuncArg = qr{$Typecast{0,1}($LvalOrFunc|$Constant|$String)}; > > > > our $declaration_macros = qr{(?x: > > (?:$Storage\s+)?(?:[A-Z_][A-Z0-9]*_){0,2}(?:DEFINE|DECLARE)(?:_[A-Z0-9]+){1,6}\s*\(| > > - (?:$Storage\s+)?LIST_HEAD\s*\(| > > + (?:$Storage\s+)?[HLP]?LIST_HEAD\s*\(| > > (?:$Storage\s+)?${Type}\s+uninitialized_var\s*\( > > )}; > > > >