diff options
author | Nico Huber <nico.h@gmx.de> | 2021-07-17 11:43:44 +0200 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2021-10-18 19:33:57 +0000 |
commit | 967730f5656e433094d97e65ce6927734d7112c7 (patch) | |
tree | e65ad0d270deab800ac298e6a4732678a0c19e8a | |
parent | dcb26139cad89f078403c375b5cb8ca38456caaf (diff) |
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>
-rwxr-xr-x | util/lint/kconfig_lint | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/util/lint/kconfig_lint b/util/lint/kconfig_lint index 7f26ef298f..76dd78764c 100755 --- a/util/lint/kconfig_lint +++ b/util/lint/kconfig_lint @@ -814,16 +814,7 @@ sub add_symbol { } 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}." ); } |