Martin Roth has submitted this change. ( https://review.coreboot.org/c/coreboot/+/56410 )
Change subject: kconfig_lint: Drop overly restrictive rule about choice configs ......................................................................
kconfig_lint: Drop overly restrictive rule about choice configs
This rule was creating trouble: * A symbol may only be declared inside or outside a choice.
The linter treats every occurence of a `config` entry as a symbol declaration, even when it's just setting a default or adding selects. This is not easy to fix as the symbol objects are not created first and then added to the $symbols array when we know what kind of decla- ration we have, but are created incrementally inside this global list.
Change-Id: I48a17f6403470251be6b6d44bb82a8bdcbefe9f6 Signed-off-by: Nico Huber nico.h@gmx.de Reviewed-on: https://review.coreboot.org/c/coreboot/+/56410 Reviewed-by: Michael Niewöhner foss@mniewoehner.de Reviewed-by: Angel Pons th3fanbus@gmail.com Reviewed-by: Martin Roth martinroth@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M util/lint/kconfig_lint 1 file changed, 1 insertion(+), 10 deletions(-)
Approvals: build bot (Jenkins): Verified Martin Roth: Looks good to me, approved Angel Pons: Looks good to me, approved Michael Niewöhner: Looks good to me, but someone else must approve
diff --git a/util/lint/kconfig_lint b/util/lint/kconfig_lint index 7f26ef2..76dd787 100755 --- a/util/lint/kconfig_lint +++ b/util/lint/kconfig_lint @@ -814,16 +814,7 @@ } else { $symbols{$symbol}{count}++; - - if ( $inside_choice && !$symbols{$symbol}{choice} ) { - show_error( "$symbol entry at $filename:$line_no has already been created inside a choice block " - . "at $symbols{$symbol}{0}{file}:$symbols{$symbol}{0}{line_no}." ); - } - elsif ( !$inside_choice && $symbols{$symbol}{choice} ) { - show_error( "$symbol entry at $filename:$line_no has already been created outside a choice block " - . "at $symbols{$symbol}{0}{file}:$symbols{$symbol}{0}{line_no}." ); - } - elsif ( $inside_choice && $symbols{$symbol}{choice} ) { + if ( $inside_choice && $symbols{$symbol}{choice} ) { show_error( "$symbol entry at $filename:$line_no has already been created inside another choice block " . "at $symbols{$symbol}{0}{file}:$symbols{$symbol}{0}{line_no}." ); }