History

checkpatch: suppress errors triggered by short patch

When the last hunk of a patch is short it will trigger errors from checkpatch: Use of uninitialized value in pattern match (m//) at /usr/local/bin/checkpatch.pl line 394. Use of uninitialized value in concatenation (.) or string at /usr/local/bin/checkpatch.pl line 397. Use of uninitialized value in pattern match (m//) Avoid touching beyond the last line. Reported by Julien Brunel.

Andy Whitcroft committed 18 years ago

Commit dea33491 parent a1080bf1 file · +1 −0Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+1−0
@@ -408,6 +408,7 @@ sub ctx_statement_block { · 407 unmodified lines
408408 # context.
409409 if ($off >= $len) {
410410 for (; $remain > 0; $line++) {
411+ last if (!defined $lines[$line]);
411412 next if ($lines[$line] =~ /^-/);
412413 $remain--;
413414 $loff = $len;