Re: [PATCH] docs: kdoc: parse context_lock_struct() as struct declaration

From: Jonathan Corbet

Date: Tue Sep 29 2026 - 19:09:22 EST


Omokefe Emmanuel Onanaroghene <emmaonana18@xxxxxxxxx> writes:

> kernel-doc fails to parse struct declarations wrapped in
> context_lock_struct(), e.g. struct debugfs_cancellation:
>
> include/linux/debugfs.h:245 ... error: Cannot parse struct or union!
>
> Add a struct transform that expands context_lock_struct() to a plain
> struct declaration, and apply the struct transforms to the whole
> declaration before split_struct_proto(), matching what dump_var() and
> dump_function() already do for their prototypes. The member-only
> transform in dump_struct() is then redundant.
>
> Add a regression test for the debugfs_cancellation declaration.
>
> Fixes: 6e530e2e3119 ("debugfs: Make debugfs_cancellation a context lock struct")
> Signed-off-by: Omokefe Emmanuel Onanaroghene <emmaonana18@xxxxxxxxx>
> ---
> tools/lib/python/kdoc/kdoc_parser.py | 11 +++++++----
> tools/lib/python/kdoc/xforms_lists.py | 1 +
> tools/unittests/test_kdoc_parser.py | 26 ++++++++++++++++++++++++++
> 3 files changed, 34 insertions(+), 4 deletions(-)

Applied, thanks.

jon