summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-03-03 09:42:14 +0100
committerJonathan Corbet <corbet@lwn.net>2021-03-08 17:10:24 -0700
commit0b54c2e34be7987b5e0ffc0aa0e7dced7301cc1f (patch)
tree582143e3da1af00809649c641143ead33062d73b
parente85d92b3bc3b7062f18b24092a65ec427afa8148 (diff)
scripts/kernel-doc: ignore identifier on anonymous enums
When anonymous enums are used, the identifier is empty. While, IMO, it should be avoided the usage of such enums, adding support for it is not hard. So, postpone the check for empty identifiers to happen only at the dump phase. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Link: https://lore.kernel.org/r/055ad57879f1b9381b90879e00f72fde1c3a5647.1614760910.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet <corbet@lwn.net>
-rwxr-xr-xscripts/kernel-doc9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index e1e562b2e2e7..cb92d0e1e932 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1412,9 +1412,14 @@ sub dump_enum($$) {
if ($members) {
if ($identifier ne $declaration_name) {
- print STDERR "${file}:$.: warning: expecting prototype for enum $identifier. Prototype was for enum $declaration_name instead\n";
+ if ($identifier eq "") {
+ print STDERR "${file}:$.: warning: wrong kernel-doc identifier on line:\n";
+ } else {
+ print STDERR "${file}:$.: warning: expecting prototype for enum $identifier. Prototype was for enum $declaration_name instead\n";
+ }
return;
}
+ $declaration_name = "(anonymous)" if ($declaration_name eq "");
my %_members;
@@ -2134,7 +2139,7 @@ sub process_name($$) {
++$warnings;
}
- if ($identifier eq "") {
+ if ($identifier eq "" && $decl_type ne "enum") {
print STDERR "${file}:$.: warning: wrong kernel-doc identifier on line:\n";
print STDERR $_;
++$warnings;