Re: [PATCH v3] scripts/kernel-doc: Suggest possible names for excess descriptions

From: Jonathan Corbet

Date: Wed Jul 22 2026 - 12:41:19 EST


Ryszard Knop <ryszard.knop@xxxxxxxxx> writes:

> Recent check_sections() change added a warning if a documentation tag
> member name does not match the detected struct/union member names. Since
> the checker knows all possible names, we can suggest known names, so
> that it's more obvious how to deal with the warning.
>
> Signed-off-by: Ryszard Knop <ryszard.knop@xxxxxxxxx>
> ---
> Changes in v1:
> - Added the suggestion hint in the warning, with basic name substring checks
> - Link: https://lore.kernel.org/linux-doc/20260714111208.323108-1-ryszard.knop@xxxxxxxxx/
>
> Changes in v2:
> - Strip trailing whitespace from the warning when the generated hint is empty
> - Link: https://lore.kernel.org/linux-doc/20260715111726.394565-1-ryszard.knop@xxxxxxxxx/
>
> v3:
> - Use difflib to generate suggestions even if the tag member is mistyped
> - Suggest names based on the nested struct members too
> ---
> tools/lib/python/kdoc/kdoc_parser.py | 51 ++++++++++++++++++++++++++--
> 1 file changed, 49 insertions(+), 2 deletions(-)

Applied, thanks.

jon