From 62fcb70532b7912e12c32622b7d0e0105ecf50b1 Mon Sep 17 00:00:00 2001 From: Andy Whitcroft Date: Tue, 26 Oct 2010 14:23:14 -0700 Subject: [PATCH] --- yaml --- r: 217586 b: refs/heads/master c: 53a3c4487a05b8f26ef72fe434a750a3402c998f h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/scripts/checkpatch.pl | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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)\(/) {