summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-06-14 10:54:08 -0600
committerSimon Glass <sjg@chromium.org>2020-07-09 18:57:22 -0600
commit8af45b1f20f7f56a872297873f793655fe37f8e3 (patch)
treece002d14c6c8690a1369c573c3f932cf1524a34d /scripts
parent5c430761e6a618032498fe294376a15a7ed1ee0b (diff)
downloadu-boot-8af45b1f20f7f56a872297873f793655fe37f8e3.tar.gz
checkpatch: Don't warn about PREFER_IF in headers/DT files
This warning should only be displayed for C files. Fix it and update the test. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 9544e57352..238f12cb46 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2343,7 +2343,7 @@ sub u_boot_line {
}
# use if instead of #if
- if ($line =~ /^\+#if.*CONFIG.*/) {
+ if ($realfile =~ /\.c$/ && $line =~ /^\+#if.*CONFIG.*/) {
WARN("PREFER_IF",
"Use 'if (IS_ENABLED(CONFIG...))' instead of '#if or #ifdef' where possible\n" . $herecurr);
}