[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150513123712.GA2798@mwanda>
Date: Wed, 13 May 2015 15:37:12 +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 v2] checkpatch: complain about GW-BASIC style label names
GW-BASIC style label names are annoying so we can warn about that in
checkpatch. The warnings look like:
WARNING: 'fail2' isn't informative - prefer descriptive label names
#267: FILE: ./sound/ppc/beep.c:267:
+ fail2: snd_ctl_remove(chip->card, beep_ctl);
This generates slightly under 2000 new warnings. None of them are
false positives.
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
---
v2: I don't want to warn about gotos...
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 89b1df4..c9e4c5b 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -4023,6 +4023,16 @@ sub process {
}
}
+#avoid GW-BASIC style label names
+ if ($line =~ /^.\s*((?i)(?:err|error|fail|out)[0-9]+)\s*:/) {
+ my $label = "This label";
+ if (defined $1) {
+ $label = $1;
+ }
+ WARN("BAD_LABEL_NAME",
+ "'$label' isn't informative - prefer descriptive label names\n" . $herecurr);
+ }
+
# 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