mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] scripts: checkkconfigsymbols: detect references in visible if statements
@ 2026-12-02 13:15 Hamdy Abou El Anein
  2026-12-04 14:08 ` Julian Braha
  2026-12-04 17:02 ` Nicolas Schier
  0 siblings, 2 replies; 3+ messages in thread
From: Hamdy Abou El Anein @ 2026-12-02 13:15 UTC (permalink / raw)
  To: nathan, nsc
  Cc: julianbraha, linux-kbuild, linux-kernel, ue081723,
	valentinrothberg, stefan.hengelein

checkkconfigsymbols.py does not recognize menu visibility conditions,
so undefined Kconfig symbols referenced only in a "visible if"
statement are silently missed.

The syntax is documented in the Kconfig language reference and used
in the i915, I2C and media Kconfig files, among others.

Include visible if in the statement matcher so its condition is
processed by the existing symbol extraction code.

Tested with single and compound conditions, whitespace variations,
ordinary depends on and select statements, and comments. Running the
script on a temporary Git repository also confirmed that an undefined
visibility symbol is reported while a defined symbol is not. Checked
actual visibility expressions from i915, I2C and media Kconfig files.

AI assistance: ChatGPT identified the issue, prepared the fix and
commit message, and ran local regression tests.

Signed-off-by: Hamdy Abou El Anein <info@daylightlinux.ch>
---
Changes in v2:
- Remove the Fixes tag as suggested by Julian Braha.
- No code changes.

v1: https://lore.kernel.org/linux-kbuild/20261201220106.12362-1-info@daylightlinux.ch/

 scripts/checkkconfigsymbols.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/checkkconfigsymbols.py b/scripts/checkkconfigsymbols.py
index 9f7aed98d91c..183c4f835bd9 100755
--- a/scripts/checkkconfigsymbols.py
+++ b/scripts/checkkconfigsymbols.py
@@ -24,7 +24,8 @@ SYMBOL = r"(?:\w*[A-Z0-9]\w*){2,}"
 DEF = r"^\s*(?:menu){,1}config\s+(" + SYMBOL + r")\s*"
 EXPR = r"(?:" + OPERATORS + r"|\s|" + SYMBOL + r")+"
 DEFAULT = r"default\s+.*?(?:if\s.+){,1}"
-STMT = r"^\s*(?:if|select|imply|depends\s+on|(?:" + DEFAULT + r"))\s+" + EXPR
+STMT = (r"^\s*(?:if|select|imply|depends\s+on|visible\s+if|(?:"
+        + DEFAULT + r"))\s+" + EXPR)
 SOURCE_SYMBOL = r"(?:\W|\b)+[D]{,1}CONFIG_(" + SYMBOL + r")"
 
 # regex objects
-- 
2.56.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] scripts: checkkconfigsymbols: detect references in visible if statements
  2026-12-02 13:15 [PATCH v2] scripts: checkkconfigsymbols: detect references in visible if statements Hamdy Abou El Anein
@ 2026-12-04 14:08 ` Julian Braha
  2026-12-04 17:02 ` Nicolas Schier
  1 sibling, 0 replies; 3+ messages in thread
From: Julian Braha @ 2026-12-04 14:08 UTC (permalink / raw)
  To: Hamdy Abou El Anein, nathan, nsc
  Cc: linux-kbuild, linux-kernel, ue081723, valentinrothberg, stefan.hengelein


[-- Attachment #1.1: Type: text/plain, Size: 1131 bytes --]

On 12/2/26 13:15, Hamdy Abou El Anein wrote:
> checkkconfigsymbols.py does not recognize menu visibility conditions,
> so undefined Kconfig symbols referenced only in a "visible if"
> statement are silently missed.
> 
> The syntax is documented in the Kconfig language reference and used
> in the i915, I2C and media Kconfig files, among others.
> 
> Include visible if in the statement matcher so its condition is
> processed by the existing symbol extraction code.
> 
> Tested with single and compound conditions, whitespace variations,
> ordinary depends on and select statements, and comments. Running the
> script on a temporary Git repository also confirmed that an undefined
> visibility symbol is reported while a defined symbol is not. Checked
> actual visibility expressions from i915, I2C and media Kconfig files.
> 
> AI assistance: ChatGPT identified the issue, prepared the fix and
> commit message, and ran local regression tests.
> 
> Signed-off-by: Hamdy Abou El Anein <info@daylightlinux.ch>
Tested-by: Julian Braha <julianbraha@gmail.com>
Reviewed-by: Julian Braha <julianbraha@gmail.com>

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] scripts: checkkconfigsymbols: detect references in visible if statements
  2026-12-02 13:15 [PATCH v2] scripts: checkkconfigsymbols: detect references in visible if statements Hamdy Abou El Anein
  2026-12-04 14:08 ` Julian Braha
@ 2026-12-04 17:02 ` Nicolas Schier
  1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Schier @ 2026-12-04 17:02 UTC (permalink / raw)
  To: nathan, Hamdy Abou El Anein
  Cc: julianbraha, linux-kbuild, linux-kernel, ue081723,
	valentinrothberg, stefan.hengelein

On Wed, 02 Dec 2026 14:15:58 +0100, Hamdy Abou El Anein wrote:
> scripts: checkkconfigsymbols: detect references in visible if statements

Applied w/o the explicit AI naming to kbuild/linux.git
(kbuild-next-unstable), thanks!

[1/1] scripts: checkkconfigsymbols: detect references in visible if statements
      https://git.kernel.org/kbuild/c/9bf2ea8b

Please look out for regression or issue reports or other follow up
comments, as they may result in the patch/series getting dropped,
reverted or modified (e.g. trailers).

Patches applied to the kbuild-next-unstable branch are accepted pending
wider testing in linux-next and any post-commit review; they will
generally be moved to the kbuild-next branch in about a week if no
issues are found.

Best regards,
-- 
Nicolas



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-12-04 18:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-02 13:15 [PATCH v2] scripts: checkkconfigsymbols: detect references in visible if statements Hamdy Abou El Anein
2026-12-04 14:08 ` Julian Braha
2026-12-04 17:02 ` Nicolas Schier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®