Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 328b5f41 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds
Browse files

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/5905126e70b0ed1781e49265fd5c49c5090d0223.camel@perches.com


Signed-off-by: default avatarJoe Perches <joe@perches.com>
Reported-by: default avatarJyri Sarha <jsarha@ti.com>
Cc: "Valkeinen, Tomi" <tomi.valkeinen@ti.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 9c21dae2
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -3311,7 +3311,7 @@ sub process {
			# known declaration macros
			# known declaration macros
		      $sline =~ /^\+\s+$declaration_macros/ ||
		      $sline =~ /^\+\s+$declaration_macros/ ||
			# start of struct or union or enum
			# start of struct or union or enum
		      $sline =~ /^\+\s+(?:union|struct|enum|typedef)\b/ ||
		      $sline =~ /^\+\s+(?:static\s+)?(?:const\s+)?(?:union|struct|enum|typedef)\b/ ||
			# start or end of block or continuation of declaration
			# start or end of block or continuation of declaration
		      $sline =~ /^\+\s+(?:$|[\{\}\.\#\"\?\:\(\[])/ ||
		      $sline =~ /^\+\s+(?:$|[\{\}\.\#\"\?\:\(\[])/ ||
			# bitfield continuation
			# bitfield continuation