summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index cf620c8614..17d41825c5 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2261,6 +2261,12 @@ sub u_boot_line {
WARN("CMD_TEST",
"Possible new command - make sure you add a test\n" . $herecurr);
}
+
+ # use if instead of #if
+ if ($line =~ /^\+#if.*CONFIG.*/) {
+ WARN("PREFER_IF",
+ "Use 'if (IS_ENABLED(CONFIG...))' instead of '#if or #ifdef' where possible\n" . $herecurr);
+ }
}
sub process {