1
0
Fork 0
mirror of https://github.com/u-boot/u-boot.git synced 2025-04-21 04:14:34 +00:00

checkpatch.pl: Update CONFIG logic in U-Boot section

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>
This commit is contained in:
Tom Rini 2022-12-04 10:14:14 -05:00
parent 0478dac62a
commit 2a06da08e7
2 changed files with 5 additions and 5 deletions

View file

@ -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); "strl$1 is preferred over strn$1 because it always produces a nul-terminated string\n" . $herecurr);
} }
# use defconfig to manage CONFIG_CMD options # use Kconfig for all CONFIG symbols
if ($line =~ /\+\s*#\s*(define|undef)\s+(CONFIG_CMD\w*)\b/) { if ($line =~ /\+\s*#\s*(define|undef)\s+(CONFIG_\w*)\b/) {
ERROR("DEFINE_CONFIG_CMD", ERROR("DEFINE_CONFIG_SYM",
"All commands are managed by Kconfig\n" . $herecurr); "All CONFIG symbols are managed by Kconfig\n" . $herecurr);
} }
# Don't put common.h and dm.h in header files # Don't put common.h and dm.h in header files

View file

@ -396,7 +396,7 @@ index 0000000..2234c87
"""Test for enabling/disabling commands using preprocesor""" """Test for enabling/disabling commands using preprocesor"""
pm = PatchMaker() pm = PatchMaker()
pm.add_line('common/main.c', '#undef CONFIG_CMD_WHICH') 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): def test_barred_include_in_hdr(self):
"""Test for using a barred include in a header file""" """Test for using a barred include in a header file"""