[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 13/32] kernel-doc: add support for ____cacheline_aligned attri
From: |
Paolo Bonzini |
Subject: |
[PATCH v2 13/32] kernel-doc: add support for ____cacheline_aligned attribute |
Date: |
Tue, 1 Dec 2020 05:34:43 -0500 |
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
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` is an attribute that is
not included in both steps. Add it, since it is used by kernel structs.
Based on previous patch to add ____cacheline_aligned_in_smp.
Motivated by patches to reorder this attribute to before the
variable name. Whilst we could do that in all cases, that would
be a massive change and it is more common in the kernel to place
this particular attribute after the variable name. A quick grep
suggests approximately 400 instances of which 341 have this
attribute just before a semicolon and hence after the variable name.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20200910185415.653139-1-jic23@kernel.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20201117165312.118257-13-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
scripts/kernel-doc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 3fd6f3925e..c4c5640ded 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1113,7 +1113,7 @@ sub dump_struct($$) {
my $x = shift;
my $file = shift;
- if ($x =~
/(struct|union)\s+(\w+)\s*\{(.*)\}(\s*(__packed|__aligned|____cacheline_aligned_in_smp|__attribute__\s*\(\([a-z0-9,_\s\(\)]*\)\)))*/)
{
+ if ($x =~
/(struct|union)\s+(\w+)\s*\{(.*)\}(\s*(__packed|__aligned|____cacheline_aligned_in_smp|____cacheline_aligned|__attribute__\s*\(\([a-z0-9,_\s\(\)]*\)\)))*/)
{
my $decl_type = $1;
$declaration_name = $2;
my $members = $3;
@@ -1129,6 +1129,7 @@ sub dump_struct($$) {
$members =~ s/\s*__packed\s*/ /gos;
$members =~ s/\s*CRYPTO_MINALIGN_ATTR/ /gos;
$members =~ s/\s*____cacheline_aligned_in_smp/ /gos;
+ $members =~ s/\s*____cacheline_aligned/ /gos;
# replace DECLARE_BITMAP
$members =~
s/__ETHTOOL_DECLARE_LINK_MODE_MASK\s*\(([^\)]+)\)/DECLARE_BITMAP($1,
__ETHTOOL_LINK_MODE_MASK_NBITS)/gos;
--
2.26.2
- [PATCH v2 10/32] scripts/kernel-doc: handle function pointer prototypes, (continued)
- [PATCH v2 10/32] scripts/kernel-doc: handle function pointer prototypes, Paolo Bonzini, 2020/12/01
- [PATCH v2 11/32] scripts/kernel-doc: optionally treat warnings as errors, Paolo Bonzini, 2020/12/01
- [PATCH v2 02/32] kernel-doc: fix processing nested structs with attributes, Paolo Bonzini, 2020/12/01
- [PATCH v2 16/32] Revert "kernel-doc: Use c:struct for Sphinx 3.0 and later", Paolo Bonzini, 2020/12/01
- [PATCH v2 26/32] Revert "kernel-doc: Handle function typedefs without asterisks", Paolo Bonzini, 2020/12/01
- [PATCH v2 19/32] scripts: kernel-doc: fix troubles with line counts, Paolo Bonzini, 2020/12/01
- [PATCH v2 20/32] scripts: kernel-doc: reimplement -nofunction argument, Paolo Bonzini, 2020/12/01
- [PATCH v2 25/32] scripts: kernel-doc: try to use c:function if possible, Paolo Bonzini, 2020/12/01
- [PATCH v2 12/32] kernel-doc: include line numbers for function prototypes, Paolo Bonzini, 2020/12/01
- [PATCH v2 29/32] scripts: kernel-doc: split typedef complex regex, Paolo Bonzini, 2020/12/01
- [PATCH v2 13/32] kernel-doc: add support for ____cacheline_aligned attribute,
Paolo Bonzini <=
- [PATCH v2 24/32] scripts: kernel-doc: fix line number handling, Paolo Bonzini, 2020/12/01
- [PATCH v2 23/32] scripts: kernel-doc: allow passing desired Sphinx C domain dialect, Paolo Bonzini, 2020/12/01
- [PATCH v2 27/32] Revert "kernel-doc: Handle function typedefs that return pointers", Paolo Bonzini, 2020/12/01
- [PATCH v2 22/32] scripts: kernel-doc: don't mangle with parameter list, Paolo Bonzini, 2020/12/01
- [PATCH v2 21/32] scripts: kernel-doc: fix typedef identification, Paolo Bonzini, 2020/12/01
- [PATCH v2 30/32] scripts: kernel-doc: use :c:union when needed, Paolo Bonzini, 2020/12/01
- [PATCH v2 32/32] scripts: kernel-doc: remove unnecesssary change wrt Linux, Paolo Bonzini, 2020/12/01