[PATCH] checkpatch.pl: Reword IS_ENABLED() warning

Tom Rini trini at konsulko.com
Tue Aug 2 14:33:13 CEST 2022


While there are good reasons to use 'if (IS_ENABLED(CONFIG_...))' for
runtime tests, there's equally good reasons to use '#ifdef CONFIG_...'
for build time tests.  Reword this message to hopefully avoid confusion.

Cc: Simon Glass <sjg at chromium.org>
Signed-off-by: Tom Rini <trini at konsulko.com>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index fe13e265a3fe..2d737bdb991b 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2621,7 +2621,7 @@ sub u_boot_line {
 	# use if instead of #if
 	if ($realfile =~ /\.c$/ && $line =~ /^\+#if.*CONFIG.*/) {
 		WARN("PREFER_IF",
-		     "Use 'if (IS_ENABLED(CONFIG...))' instead of '#if or #ifdef' where possible\n" . $herecurr);
+		     "Possible runtime #ifdef, see if using 'if (IS_ENABLED(CONFIG...))' instead is possible\n" . $herecurr);
 	}
 
 	# prefer strl(cpy|cat) over strn(cpy|cat)
-- 
2.25.1



More information about the U-Boot mailing list