summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAlper Nebi Yasak <alpernebiyasak@gmail.com>2020-10-05 09:57:30 +0300
committerTom Rini <trini@konsulko.com>2020-10-14 11:16:34 -0400
commitb9cca2c57a7f3f51dc044030a2f1665e517edb51 (patch)
tree42172f930f85c5529e8ea9670b8c6e84cd0dc247 /scripts
parent957a3e549314c3d9c587c91d0b582d73d3d00da7 (diff)
downloadu-boot-b9cca2c57a7f3f51dc044030a2f1665e517edb51.tar.gz
u-boot-b9cca2c57a7f3f51dc044030a2f1665e517edb51.tar.xz
u-boot-b9cca2c57a7f3f51dc044030a2f1665e517edb51.zip
checkpatch.pl: Make CONFIG_IS_ENABLED(CONFIG_*) an error
CONFIG_IS_ENABLED() takes the kconfig name without the CONFIG_ prefix, e.g. CONFIG_IS_ENABLED(CLK) for CONFIG_CLK. Make including the prefix an error in checkpatch.pl so calls in the wrong format aren't accidentally reintroduced. Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
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 4bed2b0cdc..4ed7e124c9 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2365,6 +2365,12 @@ sub u_boot_line {
ERROR("DISABLE_FDT_OR_INITRD_RELOC",
"fdt or initrd relocation disabled at boot time\n" . $herecurr);
}
+
+ # Do not use CONFIG_ prefix in CONFIG_IS_ENABLED() calls
+ if ($line =~ /^\+.*CONFIG_IS_ENABLED\(CONFIG_\w*\).*/) {
+ ERROR("CONFIG_IS_ENABLED_CONFIG",
+ "CONFIG_IS_ENABLED() takes values without the CONFIG_ prefix\n" . $herecurr);
+ }
}
sub process {