[coreboot-gerrit] Change in coreboot[master]: util/lint: Show an error if a symbol is created in two choic...

Martin Roth (Code Review) gerrit at coreboot.org
Fri Mar 24 15:52:09 CET 2017


Martin Roth has uploaded a new change for review. ( https://review.coreboot.org/18970 )

Change subject: util/lint: Show an error if a symbol is created in two choice blocks
......................................................................

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 <martinroth at google.com>
---
M util/lint/kconfig_lint
M util/lint/kconfig_lint_README
2 files changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/70/18970/1

diff --git a/util/lint/kconfig_lint b/util/lint/kconfig_lint
index bbf3e38..c9ccfb9 100755
--- a/util/lint/kconfig_lint
+++ b/util/lint/kconfig_lint
@@ -788,6 +788,10 @@
             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
diff --git a/util/lint/kconfig_lint_README b/util/lint/kconfig_lint_README
index c36320e..5bd2bdd 100644
--- a/util/lint/kconfig_lint_README
+++ b/util/lint/kconfig_lint_README
@@ -68,7 +68,8 @@
 - 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).

-- 
To view, visit https://review.coreboot.org/18970
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0acce1d40a6ca2b212c638bdb1ec65de5bd4d726
Gerrit-PatchSet: 1
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Martin Roth <martinroth at google.com>



More information about the coreboot-gerrit mailing list