From aa206478cbf1aff3ec574f5b91f2f24e96a56fee Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Fri, 24 Mar 2017 08:51:51 -0600 Subject: util/lint: Show an error if a symbol is created in two choice blocks Kconfig shows a warning about this, but we want to catch it earlier and halt the build. Change-Id: I0acce1d40a6ca2b212c638bdb1ec65de5bd4d726 Signed-off-by: Martin Roth Reviewed-on: https://review.coreboot.org/18970 Tested-by: build bot (Jenkins) Reviewed-by: Subrata Banik Reviewed-by: Patrick Georgi Reviewed-by: Paul Menzel --- util/lint/kconfig_lint | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'util/lint/kconfig_lint') diff --git a/util/lint/kconfig_lint b/util/lint/kconfig_lint index bbf3e38142..c9ccfb970e 100755 --- a/util/lint/kconfig_lint +++ b/util/lint/kconfig_lint @@ -788,6 +788,10 @@ sub add_symbol { 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 " + . "at $symbols{$symbol}{0}{file}:$symbols{$symbol}{0}{line_no}." ); + } } # add the location of this instance -- cgit v1.2.3