Skip to content

Commit 328b5f4

Browse files
JoePerchestorvalds
authored andcommitted
checkpatch: add optional static const to blank line declarations test
Using a static const struct definition as part of a series of declarations produces a false positive "Missing a blank line after declarations" for code like: WARNING: Missing a blank line after declarations #710: FILE: drivers/gpu/drm/tidss/tidss_scale_coefs.c:137: + int inc; + static const struct { So fix it. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Joe Perches <[email protected]> Reported-by: Jyri Sarha <[email protected]> Cc: "Valkeinen, Tomi" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 9c21dae commit 328b5f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/checkpatch.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3311,7 +3311,7 @@ sub process {
33113311
# known declaration macros
33123312
$sline =~ /^\+\s+$declaration_macros/ ||
33133313
# start of struct or union or enum
3314-
$sline =~ /^\+\s+(?:union|struct|enum|typedef)\b/ ||
3314+
$sline =~ /^\+\s+(?:static\s+)?(?:const\s+)?(?:union|struct|enum|typedef)\b/ ||
33153315
# start or end of block or continuation of declaration
33163316
$sline =~ /^\+\s+(?:$|[\{\}\.\#\"\?\:\(\[])/ ||
33173317
# bitfield continuation

0 commit comments

Comments
 (0)