check_compliance: allow _MODULE variant of Kconfig options

Since b53a792ff0 Zephyr has the ability to define tristate Kconfig
options. When a tristate option FOO is selected as a "module", this
results in autoconf.h defining CONFIG_FOO_MODULE, not CONFIG_FOO.

This patch allows the check_compliance script to also accept references
to a Kconfig symbol ending in _MODULE if the prefix is defined.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
This commit is contained in:
Luca Burelli 2024-06-13 15:01:40 +02:00 committed by Alberto Escolar
commit 38b0460de3

View file

@ -801,7 +801,8 @@ Missing SoC names or CONFIG_SOC vs soc.yml out of sync:
for sym_name in re.findall(regex, line):
sym_name = sym_name[7:] # Strip CONFIG_
if sym_name not in defined_syms and \
sym_name not in self.UNDEF_KCONFIG_ALLOWLIST:
sym_name not in self.UNDEF_KCONFIG_ALLOWLIST and \
not (sym_name.endswith("_MODULE") and sym_name[:-7] in defined_syms):
undef_to_locs[sym_name].append(f"{path}:{lineno}")