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

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

 



Em Tue, 9 Sep 2025 21:58:24 +0200
Mauro Carvalho Chehab <mchehab+huawei@xxxxxxxxxx> escreveu:

> Em Tue, 9 Sep 2025 00:27:20 -0700
> Randy Dunlap <rdunlap@xxxxxxxxxxxxx> escreveu:
> 
> > Hi Mauro,
> > 
> > I have a few patch nits below, then some testing info.
> > 

> see, having this:
> 
> 	.. kernel-doc:: init/kdoc-globals-test.c
> 	   :identifiers: ROOT_DEV 
> 
> will run:
> 
> 	$ ./scripts/kernel-doc init/kdoc-globals-test.c -function ROOT_DEV 
> 
> 
> 	.. c:var:: unsigned long ROOT_DEV;
> 
> 	  system root device
> 

On a side note, looking at the description you wrote for this:

	+/**
	+ * global ROOT_DEV - system root device
	+ *
	+ * @ROOT_DEV is either the successful root device or the root device
	+ * that failed boot in the boot failure message.
	+ */
	+unsigned long ROOT_DEV;

the output logic is not picking the description, while it should.
The description is there: we just need to add them to the output
data. It should be stored as "Description" inside sections.

The code to output it should be similar to:

	# For ReST
	self.out_section(args)

	# For man page:
	for section, text in args.sections.items():
            self.data += f'.SH "{section}"' + "\n"
            self.output_highlight(text)





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