From: Randy Dunlap <rdunlap@infradead.org>
To: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: Linux Doc Mailing List <linux-doc@vger.kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/2] kernel-doc: add support for handling global variables
Date: Tue, 18 Nov 2025 21:18:06 -0800 [thread overview]
Message-ID: <81442fc3-d8db-4446-8071-e72febceab69@infradead.org> (raw)
In-Reply-To: <20251118100237.46c7082a@foz.lan>
On 11/18/25 1:02 AM, Mauro Carvalho Chehab wrote:
> Em Mon, 17 Nov 2025 22:59:24 -0800
> Randy Dunlap <rdunlap@infradead.org> escreveu:
>
>> 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@infradead.org>
>>> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.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.
>
> Great!
>
>> I have a few comments/questions, all about typedefs.
>
Hi Mauro,
I just noticed that in my sample init/kdoc-globals-test.c file
(I have s/global/var/ in it), there is one global var that is missing
or misparsed:
// from net/core/rtnetlink.c:
/**
* var rtnl_mutex - historical global lock for networking control operations.
*
* @rtnl_mutex is used to serialize rtnetlink requests
* and protect all kernel internal data structures related to networking.
*
* See Documentation/networking/netdevices.rst for details.
* Often known as the rtnl_lock, although rtnl_lock is a kernel function.
*/
static DEFINE_MUTEX(rtnl_mutex);
This var is completely missing in the html output. In the man output,
it is rendered like this:
NAME
static DEFINE_MUTEX - historical global lock for networking control op‐
erations.
SYNOPSIS
static DEFINE_MUTEX;
Description
rtnl_mutex is used to serialize rtnetlink requests and protect all ker‐
nel internal data structures related to networking. See Documenta‐
tion/networking/netdevices.rst for details. Often known as the
rtnl_lock, although rtnl_lock is a kernel function.
--
~Randy
next prev parent reply other threads:[~2025-11-19 5:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-16 11:23 [PATCH v3 0/2] kernel-doc: add support for documenting vars Mauro Carvalho Chehab
2025-11-16 11:23 ` [PATCH v3 1/2] kernel-doc: add support for handling global variables Mauro Carvalho Chehab
2025-11-18 6:59 ` Randy Dunlap
2025-11-18 9:02 ` Mauro Carvalho Chehab
2025-11-18 23:50 ` Randy Dunlap
2025-11-19 5:18 ` Randy Dunlap [this message]
2025-11-19 7:30 ` Mauro Carvalho Chehab
2025-11-16 11:23 ` [PATCH v3 2/2] docs: media: v4l2-ioctl.h: document two " Mauro Carvalho Chehab
2025-11-18 6:52 ` Randy Dunlap
2025-11-21 17:50 ` [PATCH v3 0/2] kernel-doc: add support for documenting vars Jonathan Corbet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=81442fc3-d8db-4446-8071-e72febceab69@infradead.org \
--to=rdunlap@infradead.org \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab+huawei@kernel.org \
--cc=mchehab@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®