[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150507112111.GA21498@mwanda>
Date: Thu, 7 May 2015 14:21:11 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Andy Whitcroft <apw@...onical.com>
Cc: Joe Perches <joe@...ches.com>, linux-kernel@...r.kernel.org
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@...cle.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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists