]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
checkpatch.pl: Update CONFIG logic in U-Boot section
authorTom Rini <trini@konsulko.com>
Sun, 4 Dec 2022 15:14:14 +0000 (10:14 -0500)
committerTom Rini <trini@konsulko.com>
Fri, 23 Dec 2022 15:15:13 +0000 (10:15 -0500)
Now that all CONFIG symbols are in Kconfig, checkpatch.pl should check
for and error on any case of define/undef CONFIG_*.

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

index fe13e265a3fe9012845c0dd0c83b5528ce967a1d..ccfcbb3e1255bbe3cd5ef7d725e2045dd40ba686 100755 (executable)
@@ -2630,10 +2630,10 @@ sub u_boot_line {
                     "strl$1 is preferred over strn$1 because it always produces a nul-terminated string\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);
+       # use Kconfig for all CONFIG symbols
+       if ($line =~ /\+\s*#\s*(define|undef)\s+(CONFIG_\w*)\b/) {
+               ERROR("DEFINE_CONFIG_SYM",
+                     "All CONFIG symbols are managed by Kconfig\n" . $herecurr);
        }
 
        # Don't put common.h and dm.h in header files
index 8960cd505f82fefe8e27783811826aa99762f8c9..4c2ab6e590ed4050188c8c127979e9f5b4f1d4d9 100644 (file)
@@ -396,7 +396,7 @@ index 0000000..2234c87
         """Test for enabling/disabling commands using preprocesor"""
         pm = PatchMaker()
         pm.add_line('common/main.c', '#undef CONFIG_CMD_WHICH')
-        self.check_single_message(pm, 'DEFINE_CONFIG_CMD', 'error')
+        self.check_single_message(pm, 'DEFINE_CONFIG_SYM', 'error')
 
     def test_barred_include_in_hdr(self):
         """Test for using a barred include in a header file"""