scripts: kernel-doc: improve parsing for kernel-doc comments syntax
authorAditya Srivastava <yashsri421@gmail.com>
Wed, 14 Apr 2021 19:25:29 +0000 (00:55 +0530)
committerJonathan Corbet <corbet@lwn.net>
Thu, 15 Apr 2021 21:26:06 +0000 (15:26 -0600)
commitf9bbc12ccb35ac8b3fa01cec1a19cb523a7707c7
tree701af49ee108a0197f83bee87cc8e085498bd333
parent9a18473cef5292d2edde1c1f9ad69fc09091f2f6
scripts: kernel-doc: improve parsing for kernel-doc comments syntax

Currently kernel-doc does not identify some cases of probable kernel
doc comments, for e.g. pointer used as declaration type for identifier,
space separated identifier, etc.

Some example of these cases in files can be:
i)" *  journal_t * jbd2_journal_init_dev() - creates and initialises a journal structure"
in fs/jbd2/journal.c

ii) "*      dget, dget_dlock -      get a reference to a dentry" in
include/linux/dcache.h

iii) "  * DEFINE_SEQLOCK(sl) - Define a statically allocated seqlock_t"
in include/linux/seqlock.h

Also improve identification for non-kerneldoc comments. For e.g.,

i) " * The following functions allow us to read data using a swap map"
in kernel/power/swap.c does follow the kernel-doc like syntax, but the
content inside does not adheres to the expected format.

Improve parsing by adding support for these probable attempts to write
kernel-doc comment.

Suggested-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/lkml/87mtujktl2.fsf@meer.lwn.net
Signed-off-by: Aditya Srivastava <yashsri421@gmail.com>
Link: https://lore.kernel.org/r/20210414192529.9080-1-yashsri421@gmail.com
[ jc: fixed some line-length issues ]
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
scripts/kernel-doc