Re: [PATCH] update checkpatch.pl to version 0.19

From: Andy Whitcroft
Date: Thu May 01 2008 - 08:11:12 EST


> return is not a function

Bah, no matter how much testing you do something always slips through.
This one is false triggering enough to warrent a fix.

Andrew, please suck this one up on top.

-apw

=== 8< ===
return is not a function -- tighten test

Tighten the return is not a function test so that we only report it on
the line it occurs.

Signed-off-by: Andy Whitcroft <apw@xxxxxxxxxxxx>

---
diff --git a/checkpatch.pl b/checkpatch.pl
index cc9cd7c..66f060e 100755
--- a/checkpatch.pl
+++ b/checkpatch.pl
@@ -1665,7 +1665,7 @@ sub process {
}

# Return is not a function.
- if (defined($stat) && $stat =~ /\breturn(\s*)(\(.*);/s) {
+ if (defined($stat) && $stat =~ /^.\s*return(\s*)(\(.*);/s) {
my $spacing = $1;
my $value = $2;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/