checkpatch: avoid false positive closing bracket with initializers
PATCH 1/1 checkpatch: avoid false positive closing bracket with initializers
when multiple closing brackets are being used for an universal zero intializer as in (for example):
struct timespec tv[10] = {{0}};Signed-off-by Carlo Marcelo Arenas Belón <[email protected]>
--- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +1 -1
@@ -4423,7 +4423,7 @@ sub process { # closing brace should have a space following it when it has anything # on the line - if ($line =~ /}(?!(?:,|;|\)))\S/) { + if ($line =~ /}(?!(?:,|;|}|\)))\S/) { if (ERROR("SPACING", "space required after that close brace '}'\n" . $herecurr) && $fix) {
Signature · 1 line
2.14.2
Joe Perches
maintainerQuoted 4 lines · Carlo Marcelo Arenas Belón
when multiple closing brackets are being used for an universal zero intializer as in (for example):
struct timespec tv[10] = {{0}};
No objection.
scripts/checkpatch.pl
Quoted 1 line
scripts/checkpatch.pl +0
-0
[]
scripts/checkpatch.pl sub process { · line 4426
Quoted 6 lines
scripts/checkpatch.pl +1
-1@@ -4423,7 +4423,7 @@ sub process { # closing brace should have a space following it when it has anything # on the line - if ($line =~ /}(?!(?:,|;|\)))\S/) { + if ($line =~ /}(?!(?:,|;|}|\)))\S/) {
But perhaps this is easier to understand:
if ($line =~ /}(?![,;}\)]\S/