Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Omokefe Emmanuel Onanaroghene" <emmaonana18@gmail.com>,
	intel-wired-lan@lists.osuosl.org
Subject: Re: [PATCH v3] docs: kdoc: fix struct_group_tagged() parsing regression
Date: Mon, 30 Nov 2026 11:47:19 +0000	[thread overview]
Message-ID: <sashiko-outbox-240973@kernel.org> (raw)
In-Reply-To: <20261129114700.12614-1-emmaonana18@gmail.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] docs: kdoc: struct_group_tagged() inner member docs dropped
  from output
- [Medium] docs: kdoc: check_sections() suppresses prefix warnings on
  all nested structs
--

commit 6115678cf3e6e19585bd8d59787433bb0d68c597
Author: Omokefe Emmanuel Onanaroghene <emmaonana18@gmail.com>

docs: kdoc: fix struct_group_tagged() parsing regression

This commit preserves the struct tag and member name when transforming
struct_group_tagged() in kernel-doc and allows unqualified member tags in
check_sections().

Link: https://lore.kernel.org/all/0cf8ea5f-418f-45f0-907c-3d1ed4f03e9f@infradead.org/

> diff --git a/tools/lib/python/kdoc/kdoc_parser.py b/tools/lib/python/kdoc/kdoc_parser.py
> index 80d4245acd172..54b4b7bb32de4 100644
> --- a/tools/lib/python/kdoc/kdoc_parser.py
> +++ b/tools/lib/python/kdoc/kdoc_parser.py
> @@ -635,7 +635,9 @@ class KernelDoc:
>                  continue
>              if param_name.startswith("{unnamed_"):
>                  continue
> -            if param_name in self.entry.parameterlist:
> +            if param_name in self.entry.parameterlist or \
> +               any(actual.endswith('.' + param_name)
> +                   for actual in self.entry.parameterlist):
>                  continue
>  
>              hint = self.get_suggestions_hint(param_name, self.entry.parameterlist)

[Severity: Medium]
As reported by TAKANO Mitsuhiro on v2 [1], does this endswith() check
suppress excess-member warnings for ordinary named nested structs and
unions that do not use struct_group_tagged()?

When a regular nested member such as foo.bar is documented as @bar:
without its struct prefix, check_sections() now skips it instead of
warning and suggesting @foo.bar via get_suggestions_hint().

> diff --git a/tools/lib/python/kdoc/xforms_lists.py b/tools/lib/python/kdoc/xforms_lists.py
> index db23fb650ea85..a4c5b111d191f 100644
> --- a/tools/lib/python/kdoc/xforms_lists.py
> +++ b/tools/lib/python/kdoc/xforms_lists.py
> @@ -62,7 +62,7 @@ class CTransforms:
>          #
>          (CMatch("struct_group"), r"struct { \2+ };"),
>          (CMatch("struct_group_attr"), r"struct { \3+ };"),
> -        (CMatch("struct_group_tagged"), r"struct { \3+ };"),
> +        (CMatch("struct_group_tagged"), r"struct \1 { \3+ } \2;"),
>          (CMatch("__struct_group"), r"struct { \4+ };"),
>          (CMatch("context_lock_struct"), r"struct \1"),
>      ]

[Severity: Medium]
As reported by TAKANO Mitsuhiro on v2 [2], does rewriting
struct_group_tagged() into only a named nested struct cause the inner
member descriptions to be dropped from the rendered output?

rewrite_struct_members() prefixes each inner member with the group name
(such as fast.order), while dump_section() stores @order: in
self.entry.parameterdescs under the unqualified key "order".
push_parameter() then fails to find "fast.order" in parameterdescs, sets
self.entry.parameterdescs["fast.order"] = self.undescribed, and skips the
missing-description warning because "." is in the parameter name.

Because check_sections() only suppresses the excess-member warning for
"order" without copying its description to "fast.order",
RestFormat.out_struct() and ManFormat.out_struct() see
KernelDoc.undescribed for every inner member in parameterlist and omit all
of their descriptions from the generated documentation.

[1] https://lore.kernel.org/r/179527340172.2367332.3292077208678045371@gmail.com
[2] https://lore.kernel.org/r/179527340172.2367332.3292077208678045371@gmail.com

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261129114700.12614-1-emmaonana18@gmail.com?part=1

      parent reply	other threads:[~2026-11-30 11:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29 11:46 [PATCH v3] docs: kdoc: fix struct_group_tagged() parsing regression Omokefe Emmanuel Onanaroghene
2026-11-30  5:13 ` Randy Dunlap
2026-11-30 11:47 ` sashiko-bot [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=sashiko-outbox-240973@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=emmaonana18@gmail.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox