From: Steven Rostedt Date: Wed, 26 Sep 2012 18:48:17 +0000 (-0400) Subject: ktest: Fix ELSE IF statements X-Git-Tag: firefly_0821_release~3680^2~2004^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=95f57838418358e93212e9dddd60d3502c7f8e2e;p=firefly-linux-kernel-4.4.55.git ktest: Fix ELSE IF statements The ELSE IF statements do not work as expected if another ELSE statement follows. This is because the $if_set is not set. If the ELSE IF condition is true, the following ELSE should be ignored. But because the $if_set is not set, the following ELSE will also be executed. Signed-off-by: Steven Rostedt --- diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index 52b7959cd513..c05bcd293d8c 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -840,7 +840,9 @@ sub __read_config { if ($rest =~ /\sIF\s+(.*)/) { # May be a ELSE IF section. - if (!process_if($name, $1)) { + if (process_if($name, $1)) { + $if_set = 1; + } else { $skip = 1; } $rest = "";