summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2013-11-21 23:31:57 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-22 01:42:27 +0100
commitc11230f44b3c3e055e4e7cd572fc1c4a22c6f4a9 (patch)
treec6181aa0d144506cc0e08147b3ed6a60d8ff06f5
parentconfigfs: fix race between dentry put and lookup (diff)
downloadlinux-c11230f44b3c3e055e4e7cd572fc1c4a22c6f4a9.tar.xz
linux-c11230f44b3c3e055e4e7cd572fc1c4a22c6f4a9.zip
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>
Diffstat (limited to '')
-rwxr-xr-xscripts/checkpatch.pl1
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 61090e0ff613..9c9810030377 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);