Re: [PATCH v2 04/11] Documentation: Describe kconfig-audit usage and design

From: sashiko-bot

Date: Fri Dec 04 2026 - 17:50:32 EST


Thank you for your contribution! Sashiko AI review found 4 potential
issues to consider:
- [Low] docs: kconfig-audit exact-rule precedence contradicts
_map_pattern_rules()
- [Low] docs: kconfig-audit enabled pattern rule misses zero-match
failure
- [Low] docs: kconfig-audit Invocation section omits -P / --policy-file
option
- [Low] docs: kconfig-audit omits duplicate name_pattern rule rejection
--

commit b13b53469deef91d63f2604f80547d95c6a4d51c
Author: Ahmed S. Darwish <darwi@xxxxxxxxxxxxx>

Documentation: Describe kconfig-audit usage and design

This commit documents kconfig-audit usage, policy format, and dependencies,
links it from the PREEMPT_RT configuration guide, and references the new
documentation in the missing-dependency error message.

> diff --git a/Documentation/tools/kconfig-audit.rst b/Documentation/tools/kconfig-audit.rst
> new file mode 100644
> index 0000000000000..5b8e2fa842b1e
> --- /dev/null
> +++ b/Documentation/tools/kconfig-audit.rst
> @@ -0,0 +1,517 @@

[ ... ]

> +Check a ``.config`` against a policy known to the checker::
> +
> + audit.py check -c path/to/.config -p preempt_rt

[Severity: Low]
Should this section also document -P / --policy-file? parse_args() in
tools/kconfig-audit/audit.py supports checking against a custom policy
file, but this option is not mentioned anywhere in the document despite
the policy authoring guide below.

[ ... ]

> +Note that pattern priority conflicts are detected only for symbols present
> +in the checked ``.config``. An exact ``name`` rule continues to take
> +precedence over all pattern rules for such symbols.

[Severity: Low]
Does this match Checker._map_pattern_rules() in
tools/kconfig-audit/audit.py?

Checker.__post_init__() calls _map_pattern_rules() before
_find_pattern_rule_issues() checks exact rule precedence. When a symbol
in .config matches multiple highest-priority pattern rules, audit.py
aborts with EX_DATAERR even if an exact name rule covers that symbol.

Either _map_pattern_rules() should skip symbols covered by an exact rule,
or this note should reflect that conflicts are still rejected.

> +
> +Duplicate rules are rejected
> +----------------------------
> +
> +Duplicate exact symbol rules are rejected. The policy below:

[Severity: Low]
Should this section also mention duplicate name_pattern rules?
Policy.add_rule() in tools/kconfig-audit/audit.py rejects identical
name_pattern strings at parse time with EX_DATAERR, even when they have
different pattern_prio values or match no symbols in .config.

[ ... ]

> +``enabled``
> + The symbol must be set to ``y`` or ``m``.
> +
> + For an exact ``name`` rule, a missing symbol fails an ``enabled`` rule.
> + An explicitly unset symbol also fails. For a ``name_pattern`` rule, the
> + rule applies only to symbols matched in the checked ``.config``.

[Severity: Low]
Is this accurate for an enabled name_pattern rule that matches nothing in
.config?

In tools/kconfig-audit/audit.py, Checker._find_pattern_rule_issues()
reports an issue and exits with EX_CONFIG when an expected: enabled
pattern rule matches zero symbols in .config, unless an exact symbol rule
in the policy matches the regex.

--
Sashiko AI review · https://sashiko.dev/#/patchset/20261203224916.118064-1-darwi@xxxxxxxxxxxxx?part=4