]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
checkpatch.pl: Add check for defining CONFIG_CMD_xxx via config files
authorTom Rini <trini@konsulko.com>
Tue, 26 May 2020 18:29:02 +0000 (14:29 -0400)
committerTom Rini <trini@konsulko.com>
Thu, 4 Jun 2020 22:10:02 +0000 (18:10 -0400)
All of our cmds have a Kconfig entry.  Making enabling a CMD via the
config file an error to checkpatch.pl.

Signed-off-by: Tom Rini <trini@konsulko.com>
scripts/checkpatch.pl

index 17d41825c5e186222a8f2be7c134beda10a4b4c5..edba36565167b38bffbe2e1f0a09df60b7deb3e9 100755 (executable)
@@ -2267,6 +2267,12 @@ sub u_boot_line {
                WARN("PREFER_IF",
                     "Use 'if (IS_ENABLED(CONFIG...))' instead of '#if or #ifdef' where possible\n" . $herecurr);
        }
+
+       # use defconfig to manage CONFIG_CMD options
+       if ($line =~ /\+\s*#\s*(define|undef)\s+(CONFIG_CMD\w*)\b/) {
+               ERROR("DEFINE_CONFIG_CMD",
+                     "All commands are managed by Kconfig\n" . $herecurr);
+       }
 }
 
 sub process {