From: Andy Whitcroft Date: Mon, 26 Oct 2009 23:50:13 +0000 (-0700) Subject: checkpatch: correctly stop scanning at the bottom of a hunk X-Git-Tag: v2.6.32-rc6~70 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cc77cdca5209c1199deb33f3a83df191ac32f4d6;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git checkpatch: correctly stop scanning at the bottom of a hunk We are allowing context scanning checks to apply against the first line of context outside at the end of the hunk. This can lead to false matches to patch names leading to various perl warnings. Correctly stop at the bottom of the hunk. Signed-off-by: Andy Whitcroft Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index b43e309..1eca1e1 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1234,7 +1234,6 @@ sub process { $linenr++; my $rawline = $rawlines[$linenr - 1]; - my $hunk_line = ($realcnt != 0); #extract the line range in the file after the patch is applied if ($line=~/^\@\@ -\d+(?:,\d+)? \+(\d+)(,(\d+))? \@\@/) { @@ -1274,6 +1273,8 @@ sub process { $realcnt--; } + my $hunk_line = ($realcnt != 0); + #make up the handle for any error we report on this line $prefix = "$filename:$realline: " if ($emacs && $file); $prefix = "$filename:$linenr: " if ($emacs && !$file);