Re: [RFC v2] scripts: kernel-doc: fix typedef support for struct/union parsing

From
Lukas Bulwahn <lukas.bulwahn@gmail.com>
Date
2021-02-25 11:49:00
Also in
linux-kernel-mentees, lkml
Reply to
Aditya Srivastava, 2021-02-24
On Wed, Feb 24, 2021 at 2:30 PM Aditya Srivastava [off-list ref] wrote:
Currently, there are 447 files in the kernel tree, which use 'typedef
struct/union' syntax for defining some struct/union. In total, there
are ~1290 such occurrences in the kernel tree.

However, kernel-doc does not support it currently, and running
scripts/kernel-doc -none on emits:
"error: Cannot parse struct or union!"
I will help rephrasing it more precisely:

Currently, there are ~1290 occurrences in 447 files in the kernel tree
'typedef struct/union' syntax for defining some struct/union. However,
kernel-doc currently does not support that syntax. Of the ~1290
occurrences, there are four occurrences in ./include/linux/zstd.h with
typedef struct/union syntax and a preceding kernel-doc; all other
occurrences have no preceding kernel-doc.

Add support for parsing struct/union following this syntax.



I also tested it; here is my quick diff of "git ls-files | xargs
./scripts/kernel-doc -none 2>&1" before and after patch application:

< include/linux/zstd.h:154: error: Cannot parse struct or union!
< include/linux/zstd.h:171: error: Cannot parse struct or union!
< include/linux/zstd.h:181: error: Cannot parse struct or union!
18857d18853
< include/linux/zstd.h:936: error: Cannot parse struct or union!


So, again:

Tested-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>

Aditya, can you please pick up my rephrasing and send out a v3.


Lukas
Thread (13 messages) 13 messages, 4 authors, last reply 2021-03-07
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help