From 38b0460de39f8ec1aeb619214bef492bc7d577e5 Mon Sep 17 00:00:00 2001 From: Luca Burelli Date: Thu, 13 Jun 2024 15:01:40 +0200 Subject: [PATCH] check_compliance: allow _MODULE variant of Kconfig options Since b53a792ff0b 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 --- scripts/ci/check_compliance.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 5ae142f0332..b66182f8d9b 100755 --- a/scripts/ci/check_compliance.py +++ b/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): 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}")