Re: [PATCH] kconfig: add kconfig-sym-check static checker
From: Randy Dunlap
Date: Wed May 13 2026 - 19:31:25 EST
On 5/13/26 2:03 PM, Andrew Jones wrote:
> Add 'make kconfig-sym-check', a static checker that finds Kconfig
> symbols referenced in expressions (select, depends on, default, etc.)
> but never defined via config/menuconfig anywhere in the tree. New
> dangling symbols are reported as errors (exit 1) unless they are
> listed in an exclusion file, e.g.
>
> KCONFIG_SYM_CHECK_EXCLUDES=sym-check-excludes make kconfig-sym-check
>
> The checker also warns about uppercase N/Y/M used as tristate literal
> values following the same logic as checkpatch.
>
> This new static checker is the script used for [1] with a few
> improvements to avoid some false positives.
>
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=216748 [1]
> Signed-off-by: Andrew Jones <andrew.jones@xxxxxxxxx>
> ---
> Makefile | 7 ++-
> scripts/kconfig/kconfig-sym-check.pl | 93 ++++++++++++++++++++++++++++
> 2 files changed, 99 insertions(+), 1 deletion(-)
> create mode 100755 scripts/kconfig/kconfig-sym-check.pl
Acked-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
Tested-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
Thanks.
--
~Randy