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>
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user