kernel-doc: Allow anonymous enum
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 12 Aug 2019 16:06:31 +0000 (19:06 +0300)
committerJonathan Corbet <corbet@lwn.net>
Mon, 12 Aug 2019 21:00:37 +0000 (15:00 -0600)
In C is a valid construction to have an anonymous enumerator.

Though we have now:

  drivers/pinctrl/intel/pinctrl-intel.c:240: error: Cannot parse enum!

Support it in the kernel-doc script.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
scripts/kernel-doc

index 32e793c..81dc917 100755 (executable)
@@ -1245,7 +1245,7 @@ sub dump_enum($$) {
     # strip #define macros inside enums
     $x =~ s@#\s*((define|ifdef)\s+|endif)[^;]*;@@gos;
 
-    if ($x =~ /enum\s+(\w+)\s*\{(.*)\}/) {
+    if ($x =~ /enum\s+(\w*)\s*\{(.*)\}/) {
        $declaration_name = $1;
        my $members = $2;
        my %_members;