aboutsummaryrefslogtreecommitdiff
path: root/scripts/kernel-doc
diff options
context:
space:
mode:
authorAndré Almeida <andrealmeid@collabora.com>2020-11-17 17:52:45 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2020-12-10 12:15:20 -0500
commitb5a8dfb5328a5546d52522b4b3504a79464aa3cb (patch)
tree39374f53baee94ceaf968ea47b55435185d1df5e /scripts/kernel-doc
parent872e6c47a083be5afb82b40aae849c7108ae5584 (diff)
downloadqemu-b5a8dfb5328a5546d52522b4b3504a79464aa3cb.zip
qemu-b5a8dfb5328a5546d52522b4b3504a79464aa3cb.tar.gz
qemu-b5a8dfb5328a5546d52522b4b3504a79464aa3cb.tar.bz2
kernel-doc: add support for ____cacheline_aligned_in_smp attribute
Subroutine dump_struct uses type attributes to check if the struct syntax is valid. Then, it removes all attributes before using it for output. `____cacheline_aligned_in_smp` is an attribute that is not included in both steps. Add it, since it is used by kernel structs. Signed-off-by: André Almeida <andrealmeid@collabora.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20201117165312.118257-3-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'scripts/kernel-doc')
-rwxr-xr-xscripts/kernel-doc3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index d6bdb77..2f421b7 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1092,7 +1092,7 @@ sub dump_struct($$) {
my $x = shift;
my $file = shift;
- if ($x =~ /(struct|union)\s+(\w+)\s*\{(.*)\}(\s*(__packed|__aligned|__attribute__\s*\(\([a-z0-9,_\s\(\)]*\)\)))*/) {
+ if ($x =~ /(struct|union)\s+(\w+)\s*\{(.*)\}(\s*(__packed|__aligned|____cacheline_aligned_in_smp|__attribute__\s*\(\([a-z0-9,_\s\(\)]*\)\)))*/) {
my $decl_type = $1;
$declaration_name = $2;
my $members = $3;
@@ -1107,6 +1107,7 @@ sub dump_struct($$) {
$members =~ s/\s*__aligned\s*\([^;]*\)/ /gos;
$members =~ s/\s*__packed\s*/ /gos;
$members =~ s/\s*CRYPTO_MINALIGN_ATTR/ /gos;
+ $members =~ s/\s*____cacheline_aligned_in_smp/ /gos;
# replace DECLARE_BITMAP
$members =~ s/DECLARE_BITMAP\s*\(([^,)]+),\s*([^,)]+)\)/unsigned long $1\[BITS_TO_LONGS($2)\]/gos;
# replace DECLARE_HASHTABLE