From: Joe Perches Date: Thu, 21 Nov 2013 22:31:57 +0000 (-0800) Subject: checkpatch: fix "Use of uninitialized value" warnings X-Git-Tag: v3.13-rc1~17^2~11 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=c11230f44b3c3e055e4e7cd572fc1c4a22c6f4a9;p=~emulex%2Finfiniband.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 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);