lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Mon, 27 Aug 2018 09:15:20 -0700
From:   Joe Perches <joe@...ches.com>
To:     Jyri Sarha <jsarha@...com>, apw@...onical.com,
        Andrew Morton <akpm@...ux-foundation.org>
Cc:     "Valkeinen, Tomi" <tomi.valkeinen@...com>,
        LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] 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.

Reported-by: Jyri Sarha <jsarha@...com>
Signed-off-by: Joe Perches <joe@...ches.com>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 5219280bf7ff..b4caee6e269c 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3311,7 +3311,7 @@ sub process {
 			# known declaration macros
 		      $sline =~ /^\+\s+$declaration_macros/ ||
 			# 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
 		      $sline =~ /^\+\s+(?:$|[\{\}\.\#\"\?\:\(\[])/ ||
 			# bitfield continuation

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ