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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190305180238.32630-1-alex@ghiti.fr>
Date:   Tue,  5 Mar 2019 13:02:38 -0500
From:   Alexandre Ghiti <alex@...ti.fr>
To:     Andy Whitcroft <apw@...onical.com>, Joe Perches <joe@...ches.com>,
        linux-kernel@...r.kernel.org
Cc:     Alexandre Ghiti <alex@...ti.fr>
Subject: [PATCH] scripts: checkpatch: Check block comments start with /* empty line outside net

This patch ensures that apart from net code, block comments start with an
empty /* line.

Signed-off-by: Alexandre Ghiti <alex@...ti.fr>
---
 scripts/checkpatch.pl | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 7dc12c137009..bcaf5d317976 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3230,12 +3230,21 @@ sub process {
 
 # Block comment styles
 # Networking with an initial /*
-		if ($realfile =~ m@^(drivers/net/|net/)@ &&
-		    $prevrawline =~ /^\+[ \t]*\/\*[ \t]*$/ &&
-		    $rawline =~ /^\+[ \t]*\*/ &&
-		    $realline > 2) {
-			WARN("NETWORKING_BLOCK_COMMENT_STYLE",
-			     "networking block comments don't use an empty /* line, use /* Comment...\n" . $hereprev);
+		if ($realfile =~ m@^(drivers/net/|net/)@) {
+			if ($prevrawline =~ /^\+[ \t]*\/\*[ \t]*$/ &&
+			    $rawline =~ /^\+[ \t]*\*/ &&
+			    $realline > 2) {
+				WARN("NETWORKING_BLOCK_COMMENT_STYLE",
+				     "networking block comments don't use an empty /* line, use /* Comment...\n" . $hereprev);
+			}
+		} else {
+# 'Normal' with an initial empty /*
+			if ($prevrawline =~ /^\+[ \t]*\/\*[ \t]*\S/ &&
+			    $rawline =~ /^\+[ \t]*\*/ &&
+			    $realline > 2) {
+				WARN("BLOCK_COMMENT_STYLE",
+				     "block comments use an empty /* line, don't use /* Comment...\n" . $hereprev);
+			}
 		}
 
 # Block comments use * on subsequent lines
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ