diff options
| author | Russell King <rmk+kernel@arm.linux.org.uk> | 2014-08-05 10:27:13 +0100 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2014-08-05 10:27:13 +0100 |
| commit | 7109561524dc57b95fd3f9b61547268b9b6db8ed (patch) | |
| tree | df08f565b2c616b7e68fe35cd428a8c5ba3bfcb1 /scripts/checkpatch.pl | |
| parent | ARM: 8124/1: don't enter kgdb when userspace executes a kgdb break instruction (diff) | |
| parent | ARM: add comments to the early page table remap code (diff) | |
| download | linux-7109561524dc57b95fd3f9b61547268b9b6db8ed.tar.gz linux-7109561524dc57b95fd3f9b61547268b9b6db8ed.zip | |
Merge branches 'fixes' and 'misc' into for-next
Conflicts:
arch/arm/kernel/iwmmxt.S
arch/arm/mm/cache-l2x0.c
arch/arm/mm/mmu.c
Diffstat (limited to 'scripts/checkpatch.pl')
| -rwxr-xr-x | scripts/checkpatch.pl | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 010b18ef4ea0..182be0f12407 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3476,12 +3476,17 @@ sub process { } } -# unnecessary return in a void function? (a single leading tab, then return;) - if ($sline =~ /^\+\treturn\s*;\s*$/ && - $prevline =~ /^\+/) { +# unnecessary return in a void function +# at end-of-function, with the previous line a single leading tab, then return; +# and the line before that not a goto label target like "out:" + if ($sline =~ /^[ \+]}\s*$/ && + $prevline =~ /^\+\treturn\s*;\s*$/ && + $linenr >= 3 && + $lines[$linenr - 3] =~ /^[ +]/ && + $lines[$linenr - 3] !~ /^[ +]\s*$Ident\s*:/) { WARN("RETURN_VOID", - "void function return statements are not generally useful\n" . $herecurr); - } + "void function return statements are not generally useful\n" . $hereprev); + } # if statements using unnecessary parentheses - ie: if ((foo == bar)) if ($^V && $^V ge 5.10.0 && |
