Re: [PATCH] kernel-doc: add support for handling global variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 09, 2025 at 08:57:07AM -0700, Randy Dunlap wrote:
> Hi Mauro,
> 
> On 9/9/25 12:27 AM, Randy Dunlap wrote:
> > Hi Mauro,
> > 
> > I have a few patch nits below, then some testing info.
> > 
> > 
> > On 9/7/25 9:22 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@xxxxxxxxxxxxx/T/#m947c25d95cb1d96a394410ab1131dc8e9e5013f1
> >> Suggested-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
> >> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@xxxxxxxxxx>
> >> ---
> >>  scripts/lib/kdoc/kdoc_output.py | 31 +++++++++++++++++++++++++++++++
> >>  scripts/lib/kdoc/kdoc_parser.py | 25 ++++++++++++++++++++++++-
> >>  2 files changed, 55 insertions(+), 1 deletion(-)
> >>
> 
> 
> > So, I grabbed some global data from 6-8 places in the kernel and put them intoinit/kdoc-globals-test.c. Then I modified Documentation/core-api/kernel-api.rst
> > like this at the end of that file:
> > 
> > +
> > +Kernel Globals
> > +==========================
> > +
> > +.. kernel-doc:: init/kdoc-globals-test.c
> > +   :identifiers:
> > 
> > The html output says
> > "Kernel Globals"
> > but nothing else.
> > 
> > My test files are attached. I dumbed down (simplified) a few
> > of the globals from fancy types to just unsigned long, but that
> > didn't help the output results any.
> > 
> > What's happening?
> > Thanks.
> > 
> 
> My problems here could be from a patch mis-merge.
> Maybe your patch was against a tree or previous patches that I don't have.
> 
> You could supply an updated patch or I can just wait until all
> the patches are synchronized for further testing.
> Or you could just take my sample and keep testing it.

I applied it after my sphinx-build-wrapper patch series,
but it doesn't touch kernel-doc. I did a rebase just to make
sure, on the top of docs-next branch from Jon's tree, e.g. 
on the top of:

    git://git.lwn.net/linux.git docs-next

e.g. applying it after:

    7e5a0fe4e8ae ("doc: filesystems: proc: remove stale information from intro")

Patch applied cleanly.

Notice that it probably depends on some changes that Jon
applied for kernel-doc after -rc1.

If you prefer, the patch is here at global_vars branch:

https://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-docs.git/log/?h=global_vars

-- 
Thanks,
Mauro




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux