summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2019-03-04 18:22:51 -0800
committerJulius Werner <jwerner@chromium.org>2019-03-06 01:15:26 +0000
commitd60cc97526ae14b04d105e94d7ddcd86d3b18f00 (patch)
tree788912d7ead98f478dfe83e48f7fec5f0279f82e /util
parent175aa6963933f2f3162075ded3cfba5ded4c44aa (diff)
downloadcoreboot-d60cc97526ae14b04d105e94d7ddcd86d3b18f00.tar.xz
lint/kconfig: Fix check for IS_ENABLED(XXX) where someone forgot CONFIG_
This is a great check, but unfortunately it's currently not effective because most uses of IS_ENABLED() do not have whitespace in front of them (they're mostly used as part of an if (IS_ENABLED(...)) condition). This patch makes the linter a little more generous in what it considers in scope to avoid these false negatives in the future. Change-Id: I2296410c73cd6e918465c90db33e782936bec0f9 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/31746 Reviewed-by: Patrick Georgi <pgeorgi@google.com> Reviewed-by: Nico Huber <nico.h@gmx.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'util')
-rwxr-xr-xutil/lint/kconfig_lint4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/lint/kconfig_lint b/util/lint/kconfig_lint
index eddd8de6ee..dc01e718a5 100755
--- a/util/lint/kconfig_lint
+++ b/util/lint/kconfig_lint
@@ -236,11 +236,11 @@ sub check_for_ifdef {
my @collected_is_enabled;
if ($dont_use_git_grep) {
@collected_is_enabled =
- `grep -Irn -- "[[:space:]]IS_ENABLED[[:space:]]*(.*)" | grep -v '$exclude_dirs_and_files' | grep -v "kconfig.h"`;
+ `grep -Irn -- "\\<IS_ENABLED[[:space:]]*(.*)" | grep -v '$exclude_dirs_and_files' | grep -v "kconfig.h"`;
}
else {
@collected_is_enabled =
- `git grep -In -- "[[:space:]]IS_ENABLED[[:space:]]*(.*)" | grep -v '$exclude_dirs_and_files' | grep -v "kconfig.h"`;
+ `git grep -In -- "\\<IS_ENABLED[[:space:]]*(.*)" | grep -v '$exclude_dirs_and_files' | grep -v "kconfig.h"`;
}
while ( my $line = shift @collected_is_enabled ) {