aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 3cec2990d51e..bcdb54bd61a0 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2204,6 +2204,13 @@ sub process {
2204 ERROR("space required before the open parenthesis '('\n" . $herecurr); 2204 ERROR("space required before the open parenthesis '('\n" . $herecurr);
2205 } 2205 }
2206 } 2206 }
2207# Return of what appears to be an errno should normally be -'ve
2208 if ($line =~ /^.\s*return\s*(E[A-Z]*)\s*;/) {
2209 my $name = $1;
2210 if ($name ne 'EOF' && $name ne 'ERROR') {
2211 WARN("return of an errno should typically be -ve (return -$1)\n" . $herecurr);
2212 }
2213 }
2207 2214
2208# Need a space before open parenthesis after if, while etc 2215# Need a space before open parenthesis after if, while etc
2209 if ($line=~/\b(if|while|for|switch)\(/) { 2216 if ($line=~/\b(if|while|for|switch)\(/) {