Browse Source

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>
pull/74496/head
Luca Burelli 1 year ago committed by Alberto Escolar
parent
commit
38b0460de3
  1. 3
      scripts/ci/check_compliance.py

3
scripts/ci/check_compliance.py

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

Loading…
Cancel
Save