[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 30/32] scripts: kernel-doc: use :c:union when needed
From: |
Paolo Bonzini |
Subject: |
[PATCH v2 30/32] scripts: kernel-doc: use :c:union when needed |
Date: |
Tue, 1 Dec 2020 05:35:00 -0500 |
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sphinx C domain code after 3.2.1 will start complaning if :c:struct
would be used for an union type:
.../Documentation/gpu/drm-kms-helpers:352: ../drivers/video/hdmi.c:851:
WARNING: C 'identifier' cross-reference uses wrong tag: reference name is
'union hdmi_infoframe' but found name is 'struct hdmi_infoframe'. Full
reference name is 'union hdmi_infoframe'. Full found name is 'struct
hdmi_infoframe'.
So, let's address this issue too in advance, in order to
avoid future issues.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link:
https://lore.kernel.org/r/6e4ec3eec914df62389a299797a3880ae4490f35.1603791716.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20201117165312.118257-30-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
scripts/kernel-doc | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 524fc626ed..b95bae3654 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1092,7 +1092,11 @@ sub output_struct_rst(%) {
print "\n\n.. c:type:: " . $name . "\n\n";
} else {
my $name = $args{'struct'};
- print "\n\n.. c:struct:: " . $name . "\n\n";
+ if ($args{'type'} eq 'union') {
+ print "\n\n.. c:union:: " . $name . "\n\n";
+ } else {
+ print "\n\n.. c:struct:: " . $name . "\n\n";
+ }
}
print_lineno($declaration_start_line);
$lineprefix = " ";
--
2.26.2
- [PATCH v2 20/32] scripts: kernel-doc: reimplement -nofunction argument, (continued)
- [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, 2020/12/01
- [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 <=
- [PATCH v2 32/32] scripts: kernel-doc: remove unnecesssary change wrt Linux, Paolo Bonzini, 2020/12/01
- [PATCH v2 31/32] Revert "docs: temporarily disable the kernel-doc extension", Paolo Bonzini, 2020/12/01
- [PATCH v2 17/32] scripts: kernel-doc: make it more compatible with Sphinx 3.x, Paolo Bonzini, 2020/12/01
- [PATCH v2 28/32] scripts: kernel-doc: fix typedef parsing, Paolo Bonzini, 2020/12/01
- [PATCH v2 18/32] scripts: kernel-doc: use a less pedantic markup for funcs on Sphinx 3.x, Paolo Bonzini, 2020/12/01
- Re: [PATCH v2 00/32] kernel-doc: update from Linux 5.10, Peter Maydell, 2020/12/01