Skip to content

Commit 0fd7ee0

Browse files
committed
scripts/checkpatch.pl: Upgrade IS_ENABLED_CONFIG to error for U-Boot
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 <[email protected]>
1 parent e22b2d7 commit 0fd7ee0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/checkpatch.pl

+2-2
Original file line numberDiff line numberDiff line change
@@ -7205,8 +7205,8 @@ sub process {
72057205

72067206
# check for IS_ENABLED() without CONFIG_<FOO> ($rawline for comments too)
72077207
if ($rawline =~ /\bIS_ENABLED\s*\(\s*(\w+)\s*\)/ && $1 !~ /^${CONFIG_}/) {
7208-
WARN("IS_ENABLED_CONFIG",
7209-
"IS_ENABLED($1) is normally used as IS_ENABLED(${CONFIG_}$1)\n" . $herecurr);
7208+
ERROR("IS_ENABLED_CONFIG",
7209+
"IS_ENABLED($1) must be used as IS_ENABLED(${CONFIG_}$1)\n" . $herecurr);
72107210
}
72117211

72127212
# check for #if defined CONFIG_<FOO> || defined CONFIG_<FOO>_MODULE

0 commit comments

Comments
 (0)