Re: [PATCH v3] kconfig: add kconfig-sym-check static checker

From: Andrew Jones

Date: Thu May 21 2026 - 18:32:55 EST


On Thu, May 21, 2026 at 10:01:37PM +0100, Julian Braha wrote:
> On 5/21/26 21:44, Andrew Jones wrote:
> > The checker also warns about uppercase N/Y/M used as tristate literal
> > values following the same logic as checkpatch.
>
> Thanks, this is better! But...
>
> While it does catch the Y case now, it still doesn't catch 'Y' with
> quotes. Again, I had to manually inject this into Kconfig; I don't
> actually know if this is used anywhere.
>

Ah, I see kconfig interprets "default 'y'" equivalently to "default y".
That's likely due to an implementation quirk of sym_lookup() and it's a
bit frustrating and maybe even deserves a fix. At least 'Y' is still
invalid, so we can look for "N", 'N', "M", 'M', "Y", 'Y' and complain
when we see them, but that seems more like a job for the corresponding
checkpatch patch[1]. This script is looking for symbols, and symbols
should never be quoted. We only add the extra warning text in this
script for dangling N, M, Y since there's a good chance those should
have been n, m, y instead.

[1] https://lore.kernel.org/all/20260521204605.534862-1-andrew.jones@xxxxxxxxx/

Thanks,
drew