Message ID | 1387760575.22671.36.camel@joe-AO722 |
---|---|
State | Not Applicable, archived |
Delegated to: | David Miller |
Headers | show |
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 8f3aecd..29af02a 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3251,6 +3251,13 @@ sub process { } } +# if statements using unnecessary parentheses - ie: if ((foo == bar)) + if ($^V && $^V ge 5.10.0 && + $line =~ /\bif\s*\(\s*\(\s*$LvalOrFunc\s*$Compare\s*$LvalOrFunc\s*\)\s*\)/) { + WARN("UNNECESSARY_PARENTHESES", + "Unnecessary parentheses\n" . $herecurr); + } + # Return of what appears to be an errno should normally be -'ve if ($line =~ /^.\s*return\s*(E[A-Z]*)\s*;/) { my $name = $1;