diff --git a/[refs] b/[refs] index 9e5b53bbd786..24c6cf728266 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9446ef569c288e683225fec8337a0b2b81e75cc5 +refs/heads/master: 53a3c4487a05b8f26ef72fe434a750a3402c998f diff --git a/trunk/scripts/checkpatch.pl b/trunk/scripts/checkpatch.pl index 3cec2990d51e..bcdb54bd61a0 100755 --- a/trunk/scripts/checkpatch.pl +++ b/trunk/scripts/checkpatch.pl @@ -2204,6 +2204,13 @@ sub process { ERROR("space required before the open parenthesis '('\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; + if ($name ne 'EOF' && $name ne 'ERROR') { + WARN("return of an errno should typically be -ve (return -$1)\n" . $herecurr); + } + } # Need a space before open parenthesis after if, while etc if ($line=~/\b(if|while|for|switch)\(/) {