aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/checkpatch.pl7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 862cc7a740e2..f354ae619da0 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3470,6 +3470,13 @@ sub process {
3470 } 3470 }
3471 } 3471 }
3472 3472
3473# unnecessary return in a void function? (a single leading tab, then return;)
3474 if ($sline =~ /^\+\treturn\s*;\s*$/ &&
3475 $prevline =~ /^\+/) {
3476 WARN("RETURN_VOID",
3477 "void function return statements are not generally useful\n" . $herecurr);
3478 }
3479
3473# if statements using unnecessary parentheses - ie: if ((foo == bar)) 3480# if statements using unnecessary parentheses - ie: if ((foo == bar))
3474 if ($^V && $^V ge 5.10.0 && 3481 if ($^V && $^V ge 5.10.0 &&
3475 $line =~ /\bif\s*((?:\(\s*){2,})/) { 3482 $line =~ /\bif\s*((?:\(\s*){2,})/) {