Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
0b54c2e3 e85d92b3

+7 -2
+7 -2
scripts/kernel-doc
··· 1412 1412 1413 1413 if ($members) { 1414 1414 if ($identifier ne $declaration_name) { 1415 - print STDERR "${file}:$.: warning: expecting prototype for enum $identifier. Prototype was for enum $declaration_name instead\n"; 1415 + if ($identifier eq "") { 1416 + print STDERR "${file}:$.: warning: wrong kernel-doc identifier on line:\n"; 1417 + } else { 1418 + print STDERR "${file}:$.: warning: expecting prototype for enum $identifier. Prototype was for enum $declaration_name instead\n"; 1419 + } 1416 1420 return; 1417 1421 } 1422 + $declaration_name = "(anonymous)" if ($declaration_name eq ""); 1418 1423 1419 1424 my %_members; 1420 1425 ··· 2139 2134 ++$warnings; 2140 2135 } 2141 2136 2142 - if ($identifier eq "") { 2137 + if ($identifier eq "" && $decl_type ne "enum") { 2143 2138 print STDERR "${file}:$.: warning: wrong kernel-doc identifier on line:\n"; 2144 2139 print STDERR $_; 2145 2140 ++$warnings;