UPSTREAM: 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.

BUG=none
BRANCH=none
TEST=none

Change-Id: Ib1cd0d029527f51d822eb9d22fb939d96aac4460
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: aa206478cb
Original-Change-Id: I0acce1d40a6ca2b212c638bdb1ec65de5bd4d726
Original-Signed-off-by: Martin Roth <martinroth@google.com>
Original-Reviewed-on: https://review.coreboot.org/18970
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Subrata Banik <subrata.banik@intel.com>
Original-Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: https://chromium-review.googlesource.com/459509
This commit is contained in:
Martin Roth 2017-03-24 08:51:51 -06:00 committed by chrome-bot
commit 67be62a90b
2 changed files with 6 additions and 1 deletions

View file

@ -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

View file

@ -68,7 +68,8 @@ Errors in Kconfig files:
- Choice block defined with no symbols.
- The 'tristate' type is not used in coreboot.
- A 'select' keyword used outside of a config block.
- Symbols created both inside and outside of a choice block.
- Symbols created both inside and outside of a choice block or in two
different choice blocks.
- A 'range' keyword has higher minimum than maximum value.
- A config block with a prompt at the top level (the top level is currently
just for menus).