lkml.org 
[lkml]   [2008]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
FromAndy Whitcroft <>
Subject[PATCH 2/7] checkpatch: suppress errors triggered by short patch
DateTue, 2 Sep 2008 18:25:09 +0100
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.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Cc: Julien Brunel <brunel@diku.dk>
---
scripts/checkpatch.pl | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 457f874..5382f72 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -408,6 +408,7 @@ sub ctx_statement_block {
# context.
if ($off >= $len) {
for (; $remain > 0; $line++) {
+ last if (!defined $lines[$line]);
next if ($lines[$line] =~ /^-/);
$remain--;
$loff = $len;
--
1.6.0.rc1.258.g80295


\
 
 \ /
  Last update: 2008-09-02 19:29    [from the cache]
©2003-2010