checkpatch mistake on XA_STATE?
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
Joe Perches
maintainerQuoted 10 lines · David Howells
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(-)
scripts/checkpatch.pl +2 -1
@@ -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 = (
Quoted 22 lines · Joe Perches
Quoted 10 lines · David Howells
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(-)scripts/checkpatch.pl +0
-0
scripts/checkpatch.pl our $FuncArg = qr{$Typecast{0,1}($LvalOrFunc|$Constant|$String)}; · line 1046
Quoted 6 lines
scripts/checkpatch.pl +2
-1@@ -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.
Joe Perches
maintainerPATCH 1/1 checkpatch: Add XA_STATE and XA_STATE_ORDER to the macro declaration list
In reply to David HowellsXA_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.
--- scripts/checkpatch.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/checkpatch.pl +2 -1
@@ -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 = (