public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] checkpatch: complain about GW-BASIC style label names
@ 2015-05-07 11:21 Dan Carpenter
  2015-05-07 13:47 ` Joe Perches
  0 siblings, 1 reply; 11+ messages in thread
From: Dan Carpenter @ 2015-05-07 11:21 UTC (permalink / raw)
  To: Andy Whitcroft; +Cc: Joe Perches, linux-kernel

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;

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-06-04 10:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-07 11:21 [patch] checkpatch: complain about GW-BASIC style label names Dan Carpenter
2015-05-07 13:47 ` Joe Perches
2015-05-07 19:42   ` Dan Carpenter
2015-05-07 20:17     ` Joe Perches
2015-05-07 20:35       ` Joe Perches
2015-05-13 12:37       ` [patch v2] " Dan Carpenter
2015-05-13 13:16         ` David Sterba
2015-05-13 13:47           ` Dan Carpenter
2015-05-13 13:49           ` One Thousand Gnomes
2015-06-04 10:46             ` Dan Carpenter
2015-05-13 14:12         ` Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox