]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
checkpatch: comment detection may miss an implied comment on the last hunk
authorAndy Whitcroft <apw@shadowen.org>
Tue, 6 Jan 2009 22:41:16 +0000 (14:41 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 6 Jan 2009 23:59:15 +0000 (15:59 -0800)
When detecting implied comments from leading stars we may incorrectly
think we have detected an edge one way or the other when we have not if we
drop off the end of the last hunk.  Fix this up.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
scripts/checkpatch.pl

index 826cdbac01148d7b097c3eaabda20547af04a1e9..7c17e95bf36ff1f9d9ffb298c6622aed9a736ea7 100755 (executable)
@@ -1097,8 +1097,8 @@ sub process {
                                         $rawlines[$ln - 1] =~ /^-/);
                                $cnt--;
                                #print "RAW<$rawlines[$ln - 1]>\n";
-                               ($edge) = (defined $rawlines[$ln - 1] &&
-                                       $rawlines[$ln - 1] =~ m@(/\*|\*/)@);
+                               last if (!defined $rawlines[$ln - 1]);
+                               ($edge) = ($rawlines[$ln - 1] =~ m@(/\*|\*/)@);
                                last if (defined $edge);
                        }
                        if (defined $edge && $edge eq '*/') {