All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julian Braha <julianbraha@gmail.com>
To: Hamdy Abou El Anein <info@daylightlinux.ch>,
	nathan@kernel.org, nsc@kernel.org
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	ue081723@gmail.com, valentinrothberg@gmail.com,
	stefan.hengelein@fau.de
Subject: Re: [PATCH] scripts: checkkconfigsymbols: detect references in visible if statements
Date: Tue, 1 Dec 2026 23:41:28 +0000	[thread overview]
Message-ID: <8cd28cd5-3bce-4cfe-9c04-026a4ad1810f@gmail.com> (raw)
In-Reply-To: <20261201220106.12362-1-info@daylightlinux.ch>


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

Hi Hamdy,

Thanks for this, adding support in this script for 'visible if' is an
improvement.

On 12/1/26 22:01, 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.
> 
> Fixes: 24fe1f03e4ef ("checkkconfigsymbols.sh: reimplementation in python")

There are two problems with this Fixes tag:
1. support for 'visible if' was missing even before this commit,
2. adding support for 'visible if' is not fixing a bug.

please remove it in a v2.

> Signed-off-by: Hamdy Abou El Anein <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
> 

Just a note: there are actually several other parts of the Kconfig
language unsupported by these regular expressions (but this patch / a
revision certainly does not need to add all of them.)

- Julian Braha

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

      reply	other threads:[~2026-12-01 23:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 22:01 [PATCH] scripts: checkkconfigsymbols: detect references in visible if statements Hamdy Abou El Anein
2026-12-01 23:41 ` Julian Braha [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8cd28cd5-3bce-4cfe-9c04-026a4ad1810f@gmail.com \
    --to=julianbraha@gmail.com \
    --cc=info@daylightlinux.ch \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=nsc@kernel.org \
    --cc=stefan.hengelein@fau.de \
    --cc=ue081723@gmail.com \
    --cc=valentinrothberg@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.