]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
scripts/checkpatch.pl: Upgrade IS_ENABLED_CONFIG to error for U-Boot
authorTom Rini <trini@konsulko.com>
Wed, 26 Feb 2025 15:33:45 +0000 (09:33 -0600)
committerTom Rini <trini@konsulko.com>
Wed, 5 Mar 2025 18:14:49 +0000 (12:14 -0600)
A problem we have today is that some instances of IS_ENABLED(FOO) have
crept in to the code. This is in turn because with checkpatch.pl this is
only a warning and not an error, so they were overlooked. And looking
deeper, in the Linux kernel this pattern is allowed because
IS_ENABLED(DEFINED_FLAG) is allowed if discouraged and a quick skim of
the instances I saw in the current kernel follow this pattern. In U-Boot
however, this is not allowed, so bump to an error.

Signed-off-by: Tom Rini <trini@konsulko.com>
scripts/checkpatch.pl

index b8eb57f38c74ae2feae98f9021d2c408ab579bbb..f9f8891c0c4995100c07476ab997ec1c2646613f 100755 (executable)
@@ -7205,8 +7205,8 @@ sub process {
 
 # check for IS_ENABLED() without CONFIG_<FOO> ($rawline for comments too)
                if ($rawline =~ /\bIS_ENABLED\s*\(\s*(\w+)\s*\)/ && $1 !~ /^${CONFIG_}/) {
-                       WARN("IS_ENABLED_CONFIG",
-                            "IS_ENABLED($1) is normally used as IS_ENABLED(${CONFIG_}$1)\n" . $herecurr);
+                       ERROR("IS_ENABLED_CONFIG",
+                            "IS_ENABLED($1) must be used as IS_ENABLED(${CONFIG_}$1)\n" . $herecurr);
                }
 
 # check for #if defined CONFIG_<FOO> || defined CONFIG_<FOO>_MODULE