Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scripts/kernel-doc: handle function pointer prototypes

There are some function pointer prototypes inside the net
includes, like this one:

int (*pcs_config)(struct phylink_config *config, unsigned int mode,
phy_interface_t interface, const unsigned long *advertising);

There's nothing wrong using it with kernel-doc, but we need to
add a rule for it to parse such kind of prototype.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/fec520dd731a273013ae06b7653a19c7d15b9562.1592895969.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
7ae281b0 5d682f5e

+5
+5
scripts/kernel-doc
··· 1771 1771 $prototype =~ s@/\*.*?\*/@@gos; # strip comments. 1772 1772 $prototype =~ s@[\r\n]+@ @gos; # strip newlines/cr's. 1773 1773 $prototype =~ s@^\s+@@gos; # strip leading spaces 1774 + 1775 + # Handle prototypes for function pointers like: 1776 + # int (*pcs_config)(struct foo) 1777 + $prototype =~ s@^(\S+\s+)\(\s*\*(\S+)\)@$1$2@gos; 1778 + 1774 1779 if ($prototype =~ /SYSCALL_DEFINE/) { 1775 1780 syscall_munge(); 1776 1781 }