linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] checkpatch: HLIST_HEAD is also declaration
@ 2017-06-14 10:16 Steffen Maier
  2017-06-14 10:41 ` Joe Perches
  0 siblings, 1 reply; 7+ messages in thread
From: Steffen Maier @ 2017-06-14 10:16 UTC (permalink / raw)
  To: Andy Whitcroft, Joe Perches, linux-kernel; +Cc: linux-s390, Steffen Maier

Fixes the following false warning:

    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 <maier@linux.vnet.ibm.com>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index baa3c7be04ad..a539fb2561bc 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -714,7 +714,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+)?H?LIST_HEAD\s*\(|
 	(?:$Storage\s+)?${Type}\s+uninitialized_var\s*\(
 )};
 
-- 
2.11.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] checkpatch: HLIST_HEAD is also declaration
  2017-06-14 10:16 [PATCH] checkpatch: HLIST_HEAD is also declaration Steffen Maier
@ 2017-06-14 10:41 ` Joe Perches
  2017-06-14 10:45   ` Joe Perches
  0 siblings, 1 reply; 7+ messages in thread
From: Joe Perches @ 2017-06-14 10:41 UTC (permalink / raw)
  To: Steffen Maier, Andy Whitcroft, linux-kernel, Andrew Morton; +Cc: linux-s390

On Wed, 2017-06-14 at 12:16 +0200, Steffen Maier wrote:
> Fixes the following false warning:
> 
>     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 <maier@linux.vnet.ibm.com>

OK, thanks but what about PLIST_HEAD, LLIST_

What

> ---
>  scripts/checkpatch.pl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index baa3c7be04ad..a539fb2561bc 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -714,7 +714,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+)?H?LIST_HEAD\s*\(|
>  	(?:$Storage\s+)?${Type}\s+uninitialized_var\s*\(
>  )};
>  

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] checkpatch: HLIST_HEAD is also declaration
  2017-06-14 10:41 ` Joe Perches
@ 2017-06-14 10:45   ` Joe Perches
  2017-06-14 13:35     ` [PATCH v2] checkpatch: [HLP]LIST_HEAD " Steffen Maier
  0 siblings, 1 reply; 7+ messages in thread
From: Joe Perches @ 2017-06-14 10:45 UTC (permalink / raw)
  To: Steffen Maier, Andy Whitcroft, linux-kernel, Andrew Morton; +Cc: linux-s390

(drat, accidentally hit ctrl-enter)

On Wed, 2017-06-14 at 03:41 -0700, Joe Perches wrote:
> On Wed, 2017-06-14 at 12:16 +0200, Steffen Maier wrote:
> > Fixes the following false warning:
> > 
> >     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 <maier@linux.vnet.ibm.com>

OK, thanks but what about the other defines of
LLIST_HEAD, PLIST_HEAD, SLIST_HEAD ?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2] checkpatch: [HLP]LIST_HEAD is also declaration
  2017-06-14 10:45   ` Joe Perches
@ 2017-06-14 13:35     ` Steffen Maier
  2017-06-14 13:39       ` Joe Perches
  2017-06-14 13:43       ` Steffen Maier
  0 siblings, 2 replies; 7+ messages in thread
From: Steffen Maier @ 2017-06-14 13:35 UTC (permalink / raw)
  To: Andy Whitcroft, Joe Perches, linux-kernel; +Cc: linux-s390, Steffen Maier

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 <maier@linux.vnet.ibm.com>
---
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*\(
 )};
 
-- 
2.11.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] checkpatch: [HLP]LIST_HEAD is also declaration
  2017-06-14 13:35     ` [PATCH v2] checkpatch: [HLP]LIST_HEAD " Steffen Maier
@ 2017-06-14 13:39       ` Joe Perches
  2017-06-14 13:43       ` Steffen Maier
  1 sibling, 0 replies; 7+ messages in thread
From: Joe Perches @ 2017-06-14 13:39 UTC (permalink / raw)
  To: Steffen Maier, Andy Whitcroft, linux-kernel, Andrew Morton; +Cc: linux-s390

On Wed, 2017-06-14 at 15:35 +0200, 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 <maier@linux.vnet.ibm.com>
> ---
> Changes from v1:
> Extended it to also support LLIST_HEAD and PLIST_HEAD as suggested by
> Joe Perches.

Acked-by: Joe Perches <joe@perches.com>

>  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*\(
>  )};
>  

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] checkpatch: [HLP]LIST_HEAD is also declaration
  2017-06-14 13:35     ` [PATCH v2] checkpatch: [HLP]LIST_HEAD " Steffen Maier
  2017-06-14 13:39       ` Joe Perches
@ 2017-06-14 13:43       ` Steffen Maier
  2017-06-14 13:49         ` Joe Perches
  1 sibling, 1 reply; 7+ messages in thread
From: Steffen Maier @ 2017-06-14 13:43 UTC (permalink / raw)
  To: Andy Whitcroft, Joe Perches, linux-kernel; +Cc: linux-s390

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?

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 <maier@linux.vnet.ibm.com>
> ---
> 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*\(
>   )};
> 

-- 
Mit freundlichen Grüßen / Kind regards
Steffen Maier

Linux on z Systems Development

IBM Deutschland Research & Development GmbH
Vorsitzende des Aufsichtsrats: Martina Koederitz
Geschaeftsfuehrung: Dirk Wittkopp
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] checkpatch: [HLP]LIST_HEAD is also declaration
  2017-06-14 13:43       ` Steffen Maier
@ 2017-06-14 13:49         ` Joe Perches
  0 siblings, 0 replies; 7+ messages in thread
From: Joe Perches @ 2017-06-14 13:49 UTC (permalink / raw)
  To: Steffen Maier, Andy Whitcroft, linux-kernel; +Cc: linux-s390

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 <maier@linux.vnet.ibm.com>
> > ---
> > 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*\(
> >   )};
> > 
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-06-14 13:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-14 10:16 [PATCH] checkpatch: HLIST_HEAD is also declaration Steffen Maier
2017-06-14 10:41 ` Joe Perches
2017-06-14 10:45   ` Joe Perches
2017-06-14 13:35     ` [PATCH v2] checkpatch: [HLP]LIST_HEAD " Steffen Maier
2017-06-14 13:39       ` Joe Perches
2017-06-14 13:43       ` Steffen Maier
2017-06-14 13:49         ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).