[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3a27a1ff-7277-43d5-b1f2-4b26ef5595ec@infradead.org>
Date: Mon, 17 Nov 2025 22:59:24 -0800
From: Randy Dunlap <rdunlap@...radead.org>
To: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
Linux Doc Mailing List <linux-doc@...r.kernel.org>,
Jonathan Corbet <corbet@....net>
Cc: Mauro Carvalho Chehab <mchehab@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 1/2] kernel-doc: add support for handling global
variables
Hi,
On 11/16/25 3:23 AM, Mauro Carvalho Chehab wrote:
> Specially on kAPI, sometimes it is desirable to be able to
> describe global variables that are part of kAPI.
>
> Documenting vars with Sphinx is simple, as we don't need
> to parse a data struct. All we need is the variable
> declaration and use natice C domain ::c:var: to format it
> for us.
>
> Add support for it.
>
> Link: https://lore.kernel.org/linux-doc/491c3022-cef8-4860-a945-c9c4a3b63c09@infradead.org/T/#m947c25d95cb1d96a394410ab1131dc8e9e5013f1
> Suggested-by: Randy Dunlap <rdunlap@...radead.org>
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
> ---
> scripts/lib/kdoc/kdoc_output.py | 45 ++++++++++++++++++++++++++
> scripts/lib/kdoc/kdoc_parser.py | 56 ++++++++++++++++++++++++++++++++-
> 2 files changed, 100 insertions(+), 1 deletion(-)
Thanks for the update. It's looking much better.
I have a few comments/questions, all about typedefs.
type vs typedef in output (html)
typedefs are usually output as "type":
Example 1:
type func_desc_t
although thp_order_fn_t is output as:
Example 2:
thp_order_fn_t
Typedef: Get the suggested THP orders from a BPF program for allocation
+ more syntax and description.
Is the difference in the 2 examples above just that the first one has
no additional description or parameters?
3. typedef struct msi_alloc_info isn't output as a typedef at all,
but instead as a struct. But the kernel-doc for this typedef is
messed up (as taken from include/asm-generic/msi.h):
/**
* struct msi_alloc_info - Default structure for MSI interrupt allocation.
* @desc: Pointer to msi descriptor
* @hwirq: Associated hw interrupt number in the domain
* @scratchpad: Storage for implementation specific scratch data
*
* Architectures can provide their own implementation by not including
* asm-generic/msi.h into their arch specific header file.
*/
typedef struct msi_alloc_info {
struct msi_desc *desc;
irq_hw_number_t hwirq;
unsigned long flags;
union {
unsigned long ul;
void *ptr;
} scratchpad[NUM_MSI_ALLOC_SCRATCHPAD_REGS];
} msi_alloc_info_t;
a. It's a typedef, not a struct -- but we may want to print the struct (?).
b. The first line of the comment should be:
* typedef msi_alloc_info_t - Default structure for MSI interrupt allocation.
Hopefully a warning can be printed for this.
--
~Randy
Powered by blists - more mailing lists