kernel-doc: Handle function typedefs that return pointers
authorEduardo Habkost <ehabkost@redhat.com>
Sat, 3 Oct 2020 02:41:19 +0000 (22:41 -0400)
committerEduardo Habkost <ehabkost@redhat.com>
Tue, 6 Oct 2020 15:09:35 +0000 (11:09 -0400)
One example that was not being parsed correctly by kernel-doc is:

  typedef Object *(ObjectPropertyResolve)(Object *obj,
                                          void *opaque,
                                          const char *part);

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20201003024123.193840-2-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
scripts/kernel-doc

index 40ad782e3420f34f78e5bf5af53d8e7a5aca4bf9..57a4a72970f6cbafcfc65204007e0c1ee6b92a36 100755 (executable)
@@ -1318,8 +1318,8 @@ sub dump_typedef($$) {
     $x =~ s@/\*.*?\*/@@gos;    # strip comments.
 
     # Parse function prototypes
-    if ($x =~ /typedef\s+(\w+)\s*\(\*\s*(\w\S+)\s*\)\s*\((.*)\);/ ||
-       $x =~ /typedef\s+(\w+)\s*(\w\S+)\s*\s*\((.*)\);/) {
+    if ($x =~ /typedef\s+(\w+\s*\**)\s*\(\*\s*(\w\S+)\s*\)\s*\((.*)\);/ ||
+       $x =~ /typedef\s+(\w+\s*\**)\s*(\w\S+)\s*\s*\((.*)\);/) {
 
        # Function typedefs
        $return_type = $1;