summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@google.com>2018-11-23 15:55:56 +0100
committerMartin Roth <martinroth@google.com>2020-02-19 15:13:37 +0000
commitcbc5b99ac9e5856631109b1e7f20e80799beb1e4 (patch)
tree3b1b52718709f2be01fde951d6d6dcfcc1e20873 /util
parent0d866f8cd830f0ec6e84d7b284f15d2a2b485888 (diff)
downloadcoreboot-cbc5b99ac9e5856631109b1e7f20e80799beb1e4.tar.gz
coreboot-cbc5b99ac9e5856631109b1e7f20e80799beb1e4.tar.bz2
coreboot-cbc5b99ac9e5856631109b1e7f20e80799beb1e4.zip
util/lint: Allow non-option carrying named choices
named choices can be overridden with a default later-on: choice FOO config A config B config C endchoice ... if BOARD_FOO choice FOO default A endchoice endif Reflect that. Change-Id: I6662e19685f6ab0b84c78b30aedc266c0e176039 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/29813 Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Martin Roth <martinroth@google.com> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'util')
-rwxr-xr-xutil/lint/kconfig_lint8
1 files changed, 6 insertions, 2 deletions
diff --git a/util/lint/kconfig_lint b/util/lint/kconfig_lint
index 1545c8299bc9..16188bacc55d 100755
--- a/util/lint/kconfig_lint
+++ b/util/lint/kconfig_lint
@@ -530,6 +530,7 @@ sub build_and_parse_kconfig_tree {
my $inside_config = ""; # set to symbol name of the config section
my @inside_menu = (); # stack of menu names
my $inside_choice = "";
+ my $choice_symbol = "";
my $configs_inside_choice;
my %fileinfo;
@@ -617,6 +618,7 @@ sub build_and_parse_kconfig_tree {
my $symbol = $1;
add_symbol( $symbol, \@inside_menu, $filename, $line_no, \@inside_if );
handle_type( "bool", $symbol, $filename, $line_no );
+ $choice_symbol = $symbol;
}
$inside_config = "";
$inside_choice = "$filename $line_no";
@@ -633,10 +635,12 @@ sub build_and_parse_kconfig_tree {
}
$inside_choice = "";
- if ( $configs_inside_choice == 0 ) {
- show_error("choice block has no symbols at $filename:$line_no.");
+ if (( $configs_inside_choice == 0 ) &&
+ ( $choice_symbol eq "" )) {
+ show_error("unnamed choice block has no symbols at $filename:$line_no.");
}
$configs_inside_choice = 0;
+ $choice_symbol="";
}
# [optional]