scripts/kernel-doc: fix parsing of function pointers
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sun, 14 Jul 2019 09:30:23 +0000 (11:30 +0200)
committerTom Rini <trini@konsulko.com>
Wed, 24 Jul 2019 18:15:36 +0000 (14:15 -0400)
kernel-doc fails to parse function definitions like the one below

efi_status_t efi_create_event(uint32_t type, efi_uintn_t notify_tpl,
      void (EFIAPI *notify_function) (
struct efi_event *event,
void *context),
      void *notify_context, efi_guid_t *group,
      struct efi_event **event)
{

due to the "EFIAPI" attribute preceding the function name.

cf. https://lkml.org/lkml/2018/9/3/1185

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
scripts/kernel-doc

index 3350e498b4ce6331d888ed5204ef7586dfc2dd59..516cf1db32c1fc2cb0958eb01337399dab61ed8d 100755 (executable)
@@ -1382,7 +1382,7 @@ sub create_parameterlist($$$$) {
        } elsif ($arg =~ m/\(.+\)\s*\(/) {
            # pointer-to-function
            $arg =~ tr/#/,/;
-           $arg =~ m/[^\(]+\(\*?\s*([\w\.]*)\s*\)/;
+           $arg =~ m/[^\(]+\([\w\s]*\*?\s*([\w\.]*)\s*\)/;
            $param = $1;
            $type = $arg;
            $type =~ s/([^\(]+\(\*?)\s*$param/$1/;