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]
Message-Id: <20171024185542.71261-1-carenas@gmail.com>
Date:   Tue, 24 Oct 2017 11:55:42 -0700
From:   Carlo Marcelo Arenas Belón 
        <carenas@...il.com>
To:     linux-kernel@...r.kernel.org
Cc:     apw@...onical.com, joe@...ches.com,
        Carlo Marcelo Arenas Belón 
        <carenas@...il.com>
Subject: [PATCH v2] checkpatch: avoid false positive closing brace with initializers

when multiple closing braces 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 <carenas@...il.com>
---
v2: simplified regex as suggested by Joe Perches
 scripts/checkpatch.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 8b80bac055e4..9cfbdd8554fc 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -4423,12 +4423,12 @@ 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) {
 				$fixed[$fixlinenr] =~
-				    s/}((?!(?:,|;|\)))\S)/} $1/;
+				    s/}((?![,;})])\S)/} $1/;
 			}
 		}
 
-- 
2.14.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ