]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - scripts/kernel-doc
kernel-doc: strip attributes even if they have an argument
[mirror_ubuntu-bionic-kernel.git] / scripts / kernel-doc
index c1ea91c2e497ce5abc0f73241a61044094d66723..99b4847f9bb225dde733a0ecbb78c1370db9ccb1 100755 (executable)
@@ -2506,7 +2506,13 @@ sub dump_function($$) {
     $prototype =~ s/__must_check +//;
     $prototype =~ s/__weak +//;
     my $define = $prototype =~ s/^#\s*define\s+//; #ak added
-    $prototype =~ s/__attribute__\s*\(\([a-z,]*\)\)//;
+    $prototype =~ s/__attribute__\s*\(\(
+            (?:
+                 [\w\s]++          # attribute name
+                 (?:\([^)]*+\))?   # attribute arguments
+                 \s*+,?            # optional comma at the end
+            )+
+          \)\)\s+//x;
 
     # Yes, this truly is vile.  We are looking for:
     # 1. Return type (may be nothing if we're looking at a macro)