summaryrefslogtreecommitdiff
path: root/util/lint/kconfig_lint_README
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2019-03-05 17:10:19 -0800
committerPatrick Georgi <pgeorgi@google.com>2019-03-22 09:31:11 +0000
commite5eb2decd02357732f90513da5bba276fae44833 (patch)
tree291c90683949a5e8fbfab7956fc40cc25a05fb73 /util/lint/kconfig_lint_README
parentb08906b2406bf93cae692a8ac5bc75302038a4c2 (diff)
lint/kconfig: More checks, more errors
This patch changes a few more Kconfig linter warnings to errors that currently do not show up in the tree and that seem unlikely to become false positive in the future. One instance of duplicated code that essentially checks for the same thing was consolidated. It also adds a new test for references to boolean Kconfig options that do not use the CONFIG() wrapper macro. It's a little flaky (e.g. hard to handle multi-line comments), but it should be helpful the majority of the time as a warning in a Jenkins comment. Change-Id: I975ee77d392ed426f76f7671d9b6ef9441656e6a Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/31777 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'util/lint/kconfig_lint_README')
-rw-r--r--util/lint/kconfig_lint_README22
1 files changed, 12 insertions, 10 deletions
diff --git a/util/lint/kconfig_lint_README b/util/lint/kconfig_lint_README
index d20a933340..832f862422 100644
--- a/util/lint/kconfig_lint_README
+++ b/util/lint/kconfig_lint_README
@@ -43,23 +43,20 @@ Notes:
- Show when the range set for a hex or int does not match a previous range
Warnings in Kconfig files:
-- Any 'default' expressions that can never be reached.
- Symbols that are defined but never used.
-- Directories specified in a 'source' keyword do not exist.
- A 'source' keyword loading a Kconfig file that has already been loaded.
- A 'source' keyword loading a Kconfig file that doesn't exist. Note that
globs are excluded from this check.
Warnings in coreboot source files:
-- #define of Kconfig symbol - Symbols should only be defined in Kconfig.
-- #define starting with 'CONFIG_' - these should be reserved for Kconfig
- symbols.
- 'IS_ENABLED()' block that could not be interpreted.
- Kconfig files that are not loaded by a 'source' keyword.
-- '#ifdef' or '#if defined' used on bool, int, or hex - these are always
- defined in coreboot's version of Kconfig.
+- IS_ENABLED() used on a Kconfig (deprecated in favor of CONFIG())
+- Naked use of boolean CONFIG_XXX Kconfig in C that's not wrapped in CONFIG()
Errors in Kconfig files:
+- Any 'default' expressions that can never be reached.
+- Directories specified in a 'source' keyword do not exist.
- Selects do not work on symbols created in a choice block.
- All symbols used in selects or expressions must be defined in a config
statement.
@@ -94,8 +91,13 @@ Errors in Kconfig that are also caught by Kconfig itself:
- Symbols with no defined type.
Errors in coreboot source files:
-- The IS_ENABLED macro is only valid for bool symbols.
-- The IS_ENABLED used on unknown CONFIG_ value, like an obsolete symbol.
-- The IS_ENABLED macro is used on a symbol without the CONFIG_ prefix.
+- #define of Kconfig symbol - Symbols should only be defined in Kconfig.
+- #define starting with 'CONFIG_' - these should be reserved for Kconfig
+ symbols.
+- '#ifdef' or '#if defined' used on bool, int, or hex - these are always
+ defined in coreboot's version of Kconfig.
+- The CONFIG() and IS_ENABLED() macros is only valid for bool symbols.
+- CONFIG() or IS_ENABLED() used on unknown Kconfig, like an obsolete symbol.
+- The IS_ENABLED() macro is used on a symbol without the CONFIG_ prefix.
TODO: check for choice entries at the top level