summaryrefslogtreecommitdiffstats
path: root/util/lint/checkpatch.pl
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2019-04-06 16:09:46 +0200
committerNico Huber <nico.h@gmx.de>2019-06-04 13:16:16 +0000
commitec017590e54f5941f53cf33d8ebce6d311313a46 (patch)
treea9345b4b5c8ce2c5778ba39581cf2288a515ec05 /util/lint/checkpatch.pl
parent086149eb32808f2003e2951ce679b3c7728c3846 (diff)
downloadcoreboot-ec017590e54f5941f53cf33d8ebce6d311313a46.tar.gz
coreboot-ec017590e54f5941f53cf33d8ebce6d311313a46.tar.bz2
coreboot-ec017590e54f5941f53cf33d8ebce6d311313a46.zip
util/lint: Make usage of IS_ENABLED() an error
As long as we keep the IS_ENABLED() definition in libpayload for compatibility, we should check that IS_ENABLED() usage doesn't sneak back in. Also remove all other IS_ENABLED() checks. Change-Id: Id30ffa0089cec6c24fc3dbbb10a1be35f63b3d89 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/32229 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'util/lint/checkpatch.pl')
-rwxr-xr-xutil/lint/checkpatch.pl10
1 files changed, 0 insertions, 10 deletions
diff --git a/util/lint/checkpatch.pl b/util/lint/checkpatch.pl
index 265b04cef26d..1affdb7b337f 100755
--- a/util/lint/checkpatch.pl
+++ b/util/lint/checkpatch.pl
@@ -6184,16 +6184,6 @@ sub process {
}
}
-# check for #if defined CONFIG_<FOO> || defined CONFIG_<FOO>_MODULE
- if ($line =~ /^\+\s*#\s*if\s+defined(?:\s*\(?\s*|\s+)(CONFIG_[A-Z_]+)\s*\)?\s*\|\|\s*defined(?:\s*\(?\s*|\s+)\1_MODULE\s*\)?\s*$/) {
- my $config = $1;
- if (WARN("PREFER_IS_ENABLED",
- "Prefer IS_ENABLED(<FOO>) to CONFIG_<FOO> || CONFIG_<FOO>_MODULE\n" . $herecurr) &&
- $fix) {
- $fixed[$fixlinenr] = "\+#if IS_ENABLED($config)";
- }
- }
-
# check for case / default statements not preceded by break/fallthrough/switch
if ($line =~ /^.\s*(?:case\s+(?:$Ident|$Constant)\s*|default):/) {
my $has_break = 0;