lkml.org 
[lkml]   [2014]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] checkpatch: Always warn on missing blank line after variable declaration block
From
Date
Make the test system wide, modify the message too.

Signed-off-by: Joe Perches <joe@perches.com>
---
> OK, let's do this for now. Could you please cook up a followon patch
> which makes this kernel-wide? I'll play with that for a while then I'll
> decide how much I feel like irritating people.

scripts/checkpatch.pl | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index a6e3048..37a94f1 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2249,8 +2249,7 @@ sub process {
}

# check for missing blank lines after declarations
- if ($realfile =~ m@^(drivers/net/|net/)@ &&
- $prevline =~ /^\+\s+$Declare\s+$Ident/ &&
+ if ($prevline =~ /^\+\s+$Declare\s+$Ident/ &&
!($prevline =~ /(?:$Compare|$Assignment|$Operators)\s*$/ ||
$prevline =~ /(?:\{\s*|\\)$/) && #extended lines
$sline =~ /^\+\s+/ && #Not at char 1
@@ -2260,7 +2259,7 @@ sub process {
$sline =~ /^\+\s+(?:$|[\{\}\.\#\"\?\:\(])/ ||
$sline =~ /^\+\s+\(?\s*(?:$Compare|$Assignment|$Operators)/)) {
WARN("SPACING",
- "networking uses a blank line after declarations\n" . $hereprev);
+ "Missing a blank line after declarations\n" . $hereprev);
}

# check for spaces at the beginning of a line.




\
 
 \ /
  Last update: 2014-03-07 02:01    [W:0.863 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site