Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/58401 )
Change subject: kconfig_lint: use just one variable for keeping track of choices ......................................................................
kconfig_lint: use just one variable for keeping track of choices
Instead of using two variables, one for the boolean value and one for the path, use just one with the path. Since an empty string evalutes to false, this simplification does not change behaviour.
Signed-off-by: Michael Niewöhner foss@mniewoehner.de Change-Id: I2f1171789af6815094446f107f3c634332a3427e Reviewed-on: https://review.coreboot.org/c/coreboot/+/58401 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Martin Roth martinroth@google.com --- M util/lint/kconfig_lint 1 file changed, 3 insertions(+), 10 deletions(-)
Approvals: build bot (Jenkins): Verified Martin Roth: Looks good to me, approved
diff --git a/util/lint/kconfig_lint b/util/lint/kconfig_lint index 9e2c207..a3495ce 100755 --- a/util/lint/kconfig_lint +++ b/util/lint/kconfig_lint @@ -374,7 +374,7 @@ # Symbols created/used inside a choice must not have a default set. The default is set by the choice itself. if ($symbols{$sym}{choice}) { show_error("Defining a default for symbol '$sym' at $filename:$line_no, used inside choice at " - . "$symbols{$sym}{choice_loc}, is not allowed."); + . "$symbols{$sym}{choice}, is not allowed."); }
# skip good defaults @@ -802,15 +802,8 @@ #initialize the symbol or increment the use count. if ( ( !exists $symbols{$symbol} ) || ( !exists $symbols{$symbol}{count} ) ) { $symbols{$symbol}{count} = 0; - if ($inside_choice) { - $symbols{$symbol}{choice} = 1; - - # remember the location of the choice - $symbols{$symbol}{choice_loc} = $inside_choice; - } - else { - $symbols{$symbol}{choice} = 0; - } + # remember the location of the choice (or "") + $symbols{$symbol}{choice} = $inside_choice; } else { $symbols{$symbol}{count}++;