Messages in this thread Patch in this message | | | Date | Thu, 7 May 2015 14:21:11 +0300 | From | Dan Carpenter <> | 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;
| |