[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 091/113] scripts/kernel-doc: handle function pointer prototypes
From: |
Paolo Bonzini |
Subject: |
[PULL 091/113] scripts/kernel-doc: handle function pointer prototypes |
Date: |
Wed, 2 Dec 2020 03:08:27 -0500 |
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
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>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20201117165312.118257-10-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
scripts/kernel-doc | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index e8fff6a525..1cdece23fb 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1801,6 +1801,11 @@ sub process_proto_function($$) {
$prototype =~ s@/\*.*?\*/@@gos; # strip comments.
$prototype =~ s@[\r\n]+@ @gos; # strip newlines/cr's.
$prototype =~ s@^\s+@@gos; # strip leading spaces
+
+ # Handle prototypes for function pointers like:
+ # int (*pcs_config)(struct foo)
+ $prototype =~ s@^(\S+\s+)\(\s*\*(\S+)\)@$1$2@gos;
+
if ($prototype =~ /SYSCALL_DEFINE/) {
syscall_munge();
}
--
2.26.2
- [PULL 107/113] Revert "kernel-doc: Handle function typedefs without asterisks", (continued)
- [PULL 107/113] Revert "kernel-doc: Handle function typedefs without asterisks", Paolo Bonzini, 2020/12/02
- [PULL 104/113] scripts: kernel-doc: allow passing desired Sphinx C domain dialect, Paolo Bonzini, 2020/12/02
- [PULL 078/113] vl: extract softmmu/rtc.c, Paolo Bonzini, 2020/12/02
- [PULL 093/113] kernel-doc: include line numbers for function prototypes, Paolo Bonzini, 2020/12/02
- [PULL 106/113] scripts: kernel-doc: try to use c:function if possible, Paolo Bonzini, 2020/12/02
- [PULL 105/113] scripts: kernel-doc: fix line number handling, Paolo Bonzini, 2020/12/02
- [PULL 113/113] scripts: kernel-doc: remove unnecesssary change wrt Linux, Paolo Bonzini, 2020/12/02
- [PULL 111/113] scripts: kernel-doc: use :c:union when needed, Paolo Bonzini, 2020/12/02
- [PULL 099/113] scripts: kernel-doc: use a less pedantic markup for funcs on Sphinx 3.x, Paolo Bonzini, 2020/12/02
- [PULL 065/113] vl: move CHECKPOINT_INIT after preconfig, Paolo Bonzini, 2020/12/02
- [PULL 091/113] scripts/kernel-doc: handle function pointer prototypes,
Paolo Bonzini <=
- [PULL 101/113] scripts: kernel-doc: reimplement -nofunction argument, Paolo Bonzini, 2020/12/02
- [PULL 100/113] scripts: kernel-doc: fix troubles with line counts, Paolo Bonzini, 2020/12/02
- [PULL 109/113] scripts: kernel-doc: fix typedef parsing, Paolo Bonzini, 2020/12/02
- [PULL 108/113] Revert "kernel-doc: Handle function typedefs that return pointers", Paolo Bonzini, 2020/12/02
- [PULL 103/113] scripts: kernel-doc: don't mangle with parameter list, Paolo Bonzini, 2020/12/02
- [PULL 112/113] Revert "docs: temporarily disable the kernel-doc extension", Paolo Bonzini, 2020/12/02
- [PULL 110/113] scripts: kernel-doc: split typedef complex regex, Paolo Bonzini, 2020/12/02
- Re: [PULL 000/113] First batch of misc (i386, kernel-doc, memory, vl.c) changes for QEMU 6.0, no-reply, 2020/12/02
- Re: [PULL 000/113] First batch of misc (i386, kernel-doc, memory, vl.c) changes for QEMU 6.0, Peter Maydell, 2020/12/09