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>
This commit is contained in:
parent
dcb26139ca
commit
967730f565
|
@ -814,16 +814,7 @@ sub add_symbol {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$symbols{$symbol}{count}++;
|
$symbols{$symbol}{count}++;
|
||||||
|
if ( $inside_choice && $symbols{$symbol}{choice} ) {
|
||||||
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} ) {
|
|
||||||
show_error( "$symbol entry at $filename:$line_no has already been created inside another choice block "
|
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}." );
|
. "at $symbols{$symbol}{0}{file}:$symbols{$symbol}{0}{line_no}." );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue