Commit 721c1cb60e0546d2e71b9aa50426c94e69c6521a

Authored by Andy Whitcroft
Committed by Linus Torvalds
1 parent 691d77b6b8

checkpatch: comment detection may miss an implied comment on the last hunk

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>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

scripts/checkpatch.pl
... ... @@ -1097,8 +1097,8 @@
1097 1097 $rawlines[$ln - 1] =~ /^-/);
1098 1098 $cnt--;
1099 1099 #print "RAW<$rawlines[$ln - 1]>\n";
1100   - ($edge) = (defined $rawlines[$ln - 1] &&
1101   - $rawlines[$ln - 1] =~ m@(/\*|\*/)@);
  1100 + last if (!defined $rawlines[$ln - 1]);
  1101 + ($edge) = ($rawlines[$ln - 1] =~ m@(/\*|\*/)@);
1102 1102 last if (defined $edge);
1103 1103 }
1104 1104 if (defined $edge && $edge eq '*/') {