lkml.org 
[lkml]   [2019]   [Mar]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] scripts: checkpatch: Check block comments start with /* empty line outside net
Date
This patch ensures that apart from net code, block comments start with an
empty /* line.

Signed-off-by: Alexandre Ghiti <alex@ghiti.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
\
 
 \ /
  Last update: 2019-03-05 19:03    [W:1.359 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site