public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Andy Whitcroft <apw@canonical.com>
Cc: Joe Perches <joe@perches.com>, linux-kernel@vger.kernel.org
Subject: [patch] checkpatch: complain about GW-BASIC style label names
Date: Thu, 7 May 2015 14:21:11 +0300	[thread overview]
Message-ID: <20150507112111.GA21498@mwanda> (raw)

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;

             reply	other threads:[~2015-05-07 11:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-07 11:21 Dan Carpenter [this message]
2015-05-07 13:47 ` [patch] checkpatch: complain about GW-BASIC style label names 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150507112111.GA21498@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=apw@canonical.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox