linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* checkpatch mistake on XA_STATE?
@ 2022-05-25 10:13 David Howells
  2022-05-25 15:03 ` Joe Perches
  2022-05-25 19:03 ` [PATCH] checkpatch: Add XA_STATE and XA_STATE_ORDER to the macro declaration list Joe Perches
  0 siblings, 2 replies; 4+ messages in thread
From: David Howells @ 2022-05-25 10:13 UTC (permalink / raw)
  To: Andy Whitcroft, Joe Perches; +Cc: dhowells, willy, linux-kernel

I see the following:

	WARNING: Missing a blank line after declarations
	#1921: FILE: fs/cifs/smb2ops.c:4684:
	+       struct folio *folio;
	+       XA_STATE(xas, buffer, 0);

but XA_STATE() technically *is* a declaration.

Should checkpatch treat it as such?

David


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

* Re: checkpatch mistake on XA_STATE?
  2022-05-25 10:13 checkpatch mistake on XA_STATE? David Howells
@ 2022-05-25 15:03 ` Joe Perches
  2022-05-25 15:34   ` Matthew Wilcox
  2022-05-25 19:03 ` [PATCH] checkpatch: Add XA_STATE and XA_STATE_ORDER to the macro declaration list Joe Perches
  1 sibling, 1 reply; 4+ messages in thread
From: Joe Perches @ 2022-05-25 15:03 UTC (permalink / raw)
  To: David Howells, Andy Whitcroft; +Cc: willy, linux-kernel

On Wed, 2022-05-25 at 11:13 +0100, David Howells wrote:
> I see the following:
> 
> 	WARNING: Missing a blank line after declarations
> 	#1921: FILE: fs/cifs/smb2ops.c:4684:
> 	+       struct folio *folio;
> 	+       XA_STATE(xas, buffer, 0);
> 
> but XA_STATE() technically *is* a declaration.
> 
> Should checkpatch treat it as such?

Probably.
---
 scripts/checkpatch.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 503e8abbb2c1e..2cf28014132f6 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1042,7 +1042,8 @@ 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+)?[HLP]?LIST_HEAD\s*\(|
-	(?:SKCIPHER_REQUEST|SHASH_DESC|AHASH_REQUEST)_ON_STACK\s*\(
+	(?:SKCIPHER_REQUEST|SHASH_DESC|AHASH_REQUEST)_ON_STACK\s*\(|
+	(?:$Storage\s+)?(?:XA_ARRAY|XA_ARRAY_ORDER)\s*\(
 )};
 
 our %allow_repeated_words = (



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

* Re: checkpatch mistake on XA_STATE?
  2022-05-25 15:03 ` Joe Perches
@ 2022-05-25 15:34   ` Matthew Wilcox
  0 siblings, 0 replies; 4+ messages in thread
From: Matthew Wilcox @ 2022-05-25 15:34 UTC (permalink / raw)
  To: Joe Perches; +Cc: David Howells, Andy Whitcroft, linux-kernel

On Wed, May 25, 2022 at 08:03:16AM -0700, Joe Perches wrote:
> On Wed, 2022-05-25 at 11:13 +0100, David Howells wrote:
> > I see the following:
> > 
> > 	WARNING: Missing a blank line after declarations
> > 	#1921: FILE: fs/cifs/smb2ops.c:4684:
> > 	+       struct folio *folio;
> > 	+       XA_STATE(xas, buffer, 0);
> > 
> > but XA_STATE() technically *is* a declaration.
> > 
> > Should checkpatch treat it as such?
> 
> Probably.
> ---
>  scripts/checkpatch.pl | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 503e8abbb2c1e..2cf28014132f6 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -1042,7 +1042,8 @@ 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+)?[HLP]?LIST_HEAD\s*\(|
> -	(?:SKCIPHER_REQUEST|SHASH_DESC|AHASH_REQUEST)_ON_STACK\s*\(
> +	(?:SKCIPHER_REQUEST|SHASH_DESC|AHASH_REQUEST)_ON_STACK\s*\(|
> +	(?:$Storage\s+)?(?:XA_ARRAY|XA_ARRAY_ORDER)\s*\(

XA_STATE, not XA_ARRAY.


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

* [PATCH] checkpatch: Add XA_STATE and XA_STATE_ORDER to the macro declaration list
  2022-05-25 10:13 checkpatch mistake on XA_STATE? David Howells
  2022-05-25 15:03 ` Joe Perches
@ 2022-05-25 19:03 ` Joe Perches
  1 sibling, 0 replies; 4+ messages in thread
From: Joe Perches @ 2022-05-25 19:03 UTC (permalink / raw)
  To: David Howells, Andy Whitcroft, Andrew Morton; +Cc: willy, linux-kernel

XA_STATE() and XA_STATE_ORDER macro uses are declarations.

Add them to the declaration macro list to avoid suggesting a blank line
after declarations when used.

Reported-by: David Howells <dhowells@redhat.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
 scripts/checkpatch.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 503e8abbb2c1e..2cf28014132f6 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1042,7 +1042,8 @@ 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+)?[HLP]?LIST_HEAD\s*\(|
-	(?:SKCIPHER_REQUEST|SHASH_DESC|AHASH_REQUEST)_ON_STACK\s*\(
+	(?:SKCIPHER_REQUEST|SHASH_DESC|AHASH_REQUEST)_ON_STACK\s*\(|
+	(?:$Storage\s+)?(?:XA_STATE|XA_STATE_ORDER)\s*\(
 )};
 
 our %allow_repeated_words = (





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

end of thread, other threads:[~2022-05-25 19:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-25 10:13 checkpatch mistake on XA_STATE? David Howells
2022-05-25 15:03 ` Joe Perches
2022-05-25 15:34   ` Matthew Wilcox
2022-05-25 19:03 ` [PATCH] checkpatch: Add XA_STATE and XA_STATE_ORDER to the macro declaration list 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).