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

From: Randy Dunlap

Date: Sat Sep 26 2026 - 00:57:04 EST




On 9/25/26 5:14 PM, Bart Van Assche wrote:
> On 9/25/26 4:40 PM, Omokefe Emmanuel Onanaroghene wrote:
>> kernel-doc fails to parse struct declarations wrapped in
>> context_lock_struct(), e.g. struct debugfs_cancellation:
>
> Has this alternative been considered: instead of modifying
> tools/lib/python/kdoc/kdoc_parser.py, apply the following change:

I don't think that has been tried/considered.
I'm OK with it if Marco & Peter are.

> diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h
> index 4177c4738282..aa591f0b0920 100644
> --- a/include/linux/debugfs.h
> +++ b/include/linux/debugfs.h
> @@ -233,13 +233,14 @@ ssize_t debugfs_write_file_bool(struct file *file, const char __user *user_buf,
>  ssize_t debugfs_read_file_str(struct file *file, char __user *user_buf,
>                    size_t count, loff_t *ppos);
>
> +context_lock_struct(debugfs_cancellation);
>  /**
>   * struct debugfs_cancellation - cancellation data
>   * @list: internal, for keeping track
>   * @cancel: callback to call
>   * @cancel_data: extra data for the callback to call
>   */
> -context_lock_struct(debugfs_cancellation) {
> +struct debugfs_cancellation {
>      struct list_head list;
>      void (*cancel)(struct dentry *, void *);
>      void *cancel_data;
>
> Thanks,
>
> Bart.

thanks.
--
~Randy