lkml.org 
[lkml]   [2015]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch] checkpatch: complain about GW-BASIC style label names
GW-BASIC style label names are quite common.  This generates a warning
like:

WARNING: bad label name
#795: FILE: drivers/ata/pata_mpc52xx.c:795:
+ err2:

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 89b1df4..ee3fa30 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -4023,6 +4023,16 @@ sub process {
}
}

+#avoid GW-BASIC style label names
+ if ($line=~/^\+\s*(err|error|fail|out)[0-9]+:/) {
+ if (WARN("LABEL_NAME",
+ "bad label name\n" . $herecurr) &&
+ $fix) {
+ $fixed[$fixlinenr] =~
+ s/^(.)\s+/$1/;
+ }
+ }
+
# return is not a function
if (defined($stat) && $stat =~ /^.\s*return(\s*)\(/s) {
my $spacing = $1;

\
 
 \ /
  Last update: 2015-05-07 13:41    [W:0.041 / U:0.940 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site