aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2013-11-21 14:31:57 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-21 16:42:27 -0800
commitc11230f44b3c3e055e4e7cd572fc1c4a22c6f4a9 (patch)
treec6181aa0d144506cc0e08147b3ed6a60d8ff06f5
parent76ae281f6307331aa063288edb6422ae99f435f0 (diff)
downloadlinux-c11230f44b3c3e055e4e7cd572fc1c4a22c6f4a9.tar.gz
checkpatch: fix "Use of uninitialized value" warnings
checkpatch is currently confused about some complex macros and references undefined variables $stat and $cond. Make sure these are defined before using them. Signed-off-by: Joe Perches <joe@perches.com> Reported-by: Gerhard Sittig <gsi@denx.de> Acked-by: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rwxr-xr-xscripts/checkpatch.pl1
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 61090e0ff61..9c981003037 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3289,6 +3289,7 @@ sub process {
}
}
if (!defined $suppress_whiletrailers{$linenr} &&
+ defined($stat) && defined($cond) &&
$line =~ /\b(?:if|while|for)\s*\(/ && $line !~ /^.\s*#/) {
my ($s, $c) = ($stat, $cond);