Article View: linux.debian.kernel
Article #464Re: [PATCH v1 03/10] kconfig-checker: Add the configuration checker code
From: sashiko-bot
Date: Sat, 07 Nov 2026 09:50
Date: Sat, 07 Nov 2026 09:50
79 lines
5709 bytes
5709 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] kconfig-checker: duplicate and non-exempted rules in
_find_issue_pattern()
--
commit 8f6e383a6cf382d507daf59d926387f2a7971370
Author: Ahmed S. Darwish <darwi@linutronix.de>
kconfig-checker: Add the configuration checker code
This commit introduces a Python-based kernel configuration checker that
validates a .config file against YAML rule profiles and reports issues by
severity.
> diff --git a/tools/kconfig-checker/check.py b/tools/kconfig-checker/check.py
> new file mode 100755
> index 0000000000000..476cd13e59eb8
> --- /dev/null
> +++ b/tools/kconfig-checker/check.py
> @@ -0,0 +1,558 @@
[ ... ]
> + def _find_issue_pattern(self, pattern_rule: PatternRule) -> Optional[PatternIssue]:
> + """Check the .config against a pattern rule. Return found issues, if any."""
> + if pattern_rule.expected == ExpectedValue.allowed:
> + return None
> +
> + violation_type = 'unset' if pattern_rule.expected == ExpectedValue.y else 'set'
> + docs_url = self.rules.get_docs_url_for(pattern_rule)
> +
> + violating_symbols = []
> +
> + for symbol in self.kconfig.get_matching_symbols(pattern_rule.symbol_regex):
> + symbol_value = self.kconfig.get_symbol_value(symbol)
> +
> + if pattern_rule.expected == ExpectedValue.y and symbol_value == 'n':
> + # Exclude the config symbol if it's explicitly disabled elsewhere
> + symbol_rule = self.rules.get_symbol_rule(symbol)
> + if symbol_rule and symbol_rule.expected == ExpectedValue.n:
> + continue
> +
> + violating_symbols.append(symbol)
> +
> + if pattern_rule.expected == ExpectedValue.n and symbol_value in ('y', 'm'):
> + # Exclude the config symbol if it's explicitly allowed elsewhere
> + symbol_rule = self.rules.get_symbol_rule(symbol)
> + if symbol_rule and symbol_rule.expected in (ExpectedValue.y, ExpectedValue.allowed):
> + continue
> +
> + violating_symbols.append(symbol)
[Severity: Low]
Should _find_issue_pattern() skip any symbol that has an explicit
SymbolRule, regardless of symbol_rule.expected?
Only checking for opposing expected values causes two issues: when
pattern_rule.expected is ExpectedValue.y, a symbol with a SymbolRule of
ExpectedValue.allowed is not exempted and is falsely reported as unset, and
when a SymbolRule has the same expected value as the PatternRule (for
example, to give a specific symbol its own severity or rationale), the
violation is reported twice—once by _find_issue_symbol() and once by
_find_issue_pattern().
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261106091922.7560-1-darwi@linutronix.de?part=3
Technical Details
Message-ID:
<NWLdD-amPt-3@gated-at.bofh.it>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.nntp4.net!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomodReferences:
<NWoK5-aaez-7@gated-at.bofh.it> <NWLdD-amPt-5@gated-at.bofh.it>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.nntp4.net!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod From: sashiko-bot@kernel.org Newsgroups: linux.debian.kernel,linux.kernel Subject: Re: [PATCH v1 03/10] kconfig-checker: Add the configuration checker code Date: Sat, 07 Nov 2026 10:50:01 +0100 Message-ID: <NWLdD-amPt-3@gated-at.bofh.it> References: <NWoK5-aaez-7@gated-at.bofh.it> <NWLdD-amPt-5@gated-at.bofh.it> X-Original-To: "Ahmed S. Darwish" <darwi@linutronix.de>, "Clark Williams" <clrkwllms@kernel.org>, "Steven Rostedt" <rostedt@goodmis.org>, "Ingo Molnar" <mingo@redhat.com>, "Nathan Chancellor" <nathan@kernel.org>, "Nicolas Schier" <nsc@kernel.org> X-Mailbox-Line: From debian-kernel-request@lists.debian.org Sat Nov 7 09:48:09 2026 Old-Return-Path: <sashiko-bot@kernel.org> X-Amavis-Spam-Status: No, score=-4.401 tagged_above=-10000 required=5.3 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3] autolearn=ham autolearn_force=no X-Policyd-Weight: using cached result; rate: -5.5 X-Greylist: delayed 624 seconds by postgrey-1.37 at bendel; Sat, 07 Nov 2026 09:30:53 UTC Reply-To: sashiko-reviews@lists.linux.dev Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Mailing-List: <debian-kernel@lists.debian.org> archive/latest/158105 List-ID: <debian-kernel.lists.debian.org> List-URL: <https://lists.debian.org/debian-kernel/> List-Archive: https://lists.debian.org/msgid-search/sashiko-outbox-202758@kernel.org Approved: robomod@news.nic.it Lines: 79 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Cc: "Sebastian Andrzej Siewior" <bigeasy@linutronix.de>, "Frederic Weisbecker" <frederic@kernel.org>, "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>, "Jonathan Corbet" <corbet@lwn.net>, "John Ogness" <john.ogness@linutronix.de>, "Derek Barbosa" <debarbos@redhat.com>, Zbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>, "Daan De Meyer" <daan.j.demeyer@gmail.com>, "Luca Boccassi" <luca.boccassi@gmail.com>, linux-rt-devel@lists.linux.dev, debian-kernel@lists.debian.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org X-Original-Date: Sat, 07 Nov 2026 09:20:25 +0000 X-Original-Message-ID: <sashiko-outbox-202758@kernel.org> X-Original-References: <20261106091922.7560-1-darwi@linutronix.de> <20261106091922.7560-4-darwi@linutronix.de>