[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 09/29] scripts/kernel-doc: handle function pointer prototypes
From: |
Paolo Bonzini |
Subject: |
[PATCH 09/29] scripts/kernel-doc: handle function pointer prototypes |
Date: |
Tue, 17 Nov 2020 17:52:52 +0100 |
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>
---
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.28.0
- [RFC PATCH 00/29] kernel-doc: update from Linux 5.10, Paolo Bonzini, 2020/11/17
- [PATCH 01/29] kernel-doc: fix processing nested structs with attributes, Paolo Bonzini, 2020/11/17
- [PATCH 02/29] kernel-doc: add support for ____cacheline_aligned_in_smp attribute, Paolo Bonzini, 2020/11/17
- [PATCH 03/29] scripts/kernel-doc: Add support for named variable macro arguments, Paolo Bonzini, 2020/11/17
- [PATCH 04/29] scripts: kernel-doc: proper handle @foo->bar(), Paolo Bonzini, 2020/11/17
- [PATCH 06/29] scripts: kernel-doc: accept blank lines on parameter description, Paolo Bonzini, 2020/11/17
- [PATCH 05/29] scripts: kernel-doc: accept negation like !@var, Paolo Bonzini, 2020/11/17
- [PATCH 07/29] Replace HTTP links with HTTPS ones: documentation, Paolo Bonzini, 2020/11/17
- [PATCH 08/29] scripts/kernel-doc: parse __ETHTOOL_DECLARE_LINK_MODE_MASK, Paolo Bonzini, 2020/11/17
- [PATCH 09/29] scripts/kernel-doc: handle function pointer prototypes,
Paolo Bonzini <=
- [PATCH 10/29] scripts/kernel-doc: optionally treat warnings as errors, Paolo Bonzini, 2020/11/17
- [PATCH 12/29] kernel-doc: add support for ____cacheline_aligned attribute, Paolo Bonzini, 2020/11/17
- [PATCH 11/29] kernel-doc: include line numbers for function prototypes, Paolo Bonzini, 2020/11/17
- [PATCH 13/29] scripts: kernel-doc: add support for typedef enum, Paolo Bonzini, 2020/11/17
- [PATCH 14/29] Revert "scripts/kerneldoc: For Sphinx 3 use c:macro for macros with arguments", Paolo Bonzini, 2020/11/17
- [PATCH 15/29] Revert "kernel-doc: Use c:struct for Sphinx 3.0 and later", Paolo Bonzini, 2020/11/17
- [PATCH 16/29] scripts: kernel-doc: make it more compatible with Sphinx 3.x, Paolo Bonzini, 2020/11/17
- [PATCH 18/29] scripts: kernel-doc: fix troubles with line counts, Paolo Bonzini, 2020/11/17
- [PATCH 17/29] scripts: kernel-doc: use a less pedantic markup for funcs on Sphinx 3.x, Paolo Bonzini, 2020/11/17
- [PATCH 19/29] scripts: kernel-doc: reimplement -nofunction argument, Paolo Bonzini, 2020/11/17