Re: [PATCH] docs: kdoc: parse context_lock_struct() as struct declaration
From: Omokefe Emmanuel Onanaroghene
Date: Sat Sep 26 2026 - 05:54:35 EST
Hi Bart,
> Has this alternative been considered: instead of modifying
> tools/lib/python/kdoc/kdoc_parser.py, apply the following change:
Thanks for taking the time to review this. I tried your split
(`context_lock_struct()` above the comment, plain `struct` below), and it
does fix the warning.
> +context_lock_struct(debugfs_cancellation);
> ...
> -context_lock_struct(debugfs_cancellation) {
> +struct debugfs_cancellation {
I still think the tool-side fix is the better route: `debugfs_cancellation`
is the only one with a kernel-doc comment today, but the next comment
added above any of the others would hit the same error, and we'd be
fixing the same warning again.
The part that really sold me on changing the tool was a general ordering
issue in `dump_struct()`: unlike `dump_var()` and `dump_function()`, it
applied the transforms only to the members after `split_struct_proto()`,
so they could never repair the declaration line itself. Moving the
transform earlier fixes that, and a full-tree A/B test removes the
existing warning without adding any new ones.
Would you and Marco prefer the tool-side fix, or should I respin with the
`debugfs.h` change?
Thanks,
Omokefe