From: Joe Perches Date: Thu, 21 Nov 2013 22:31:57 +0000 (-0800) Subject: checkpatch: fix "Use of uninitialized value" warnings X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=c11230f44b3c3e055e4e7cd572fc1c4a22c6f4a9;p=openwrt%2Fstaging%2Fblogic.git 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 Reported-by: Gerhard Sittig Acked-by: Andy Whitcroft Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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);