kernel-doc: Allow anonymous enum
PATCH 1/1 kernel-doc: Allow anonymous enum
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.
--- scripts/kernel-doc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/kernel-doc +1 -1
@@ -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;
Signature · 1 line
2.20.1
Quoted 7 lines · On Mon, 12 Aug 2019 19:06:31 +0300 Andy Shevchenko…
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.
So I don't get this error; I guess the only anonymous enum of interest has yet to find its way into the mainline.
Quoted 10 lines
Signed-off-by Andy Shevchenko <[email protected]>--- scripts/kernel-doc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/kernel-doc +0
-0
scripts/kernel-doc sub dump_enum($$) { · line 1248
Quoted 5 lines
scripts/kernel-doc +1
-1@@ -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*\{(.*)\}/) {
Ah the joy of regexes...
Applied, thanks.
jon
Quoted 5 lines · Jonathan Corbet
Quoted 2 lines · On Mon, 12 Aug 2019 19:06:31 +0300 Andy Shevchenko…
In C is a valid construction to have an anonymous enumerator.
Quoted 8 lines
Quoted 5 lines
Though we have now:
drivers/pinctrl/intel/pinctrl-intel.c:240: error: Cannot parse enum!Support it in the kernel-doc script.
So I don't get this error; I guess the only anonymous enum of interest has yet to find its way into the mainline.
The other one is already in mainline (drivers/remoteproc/omap_remoteproc.h), but suddenly it misses the second * in the header of kernel-doc comment (perhaps to avoid above error, or for another reason).
Quoted 14 lines
Quoted 14 lines
Signed-off-by Andy Shevchenko <[email protected]>--- scripts/kernel-doc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/kernel-doc +0
-0@@ -1245,7 +1245,7 @@ sub dump_enum($$) { # strip #define macros inside enums $x =~ s@#\s*((define|ifdef)\s+|endif)[^;]*;@@gos;
Quoted 6 lines
scripts/kernel-doc sub dump_enum($$) { · line 1248
Quoted 2 lines
scripts/kernel-doc +1
-1- if ($x =~ /enum\s+(\w+)\s*\{(.*)\}/) { + if ($x =~ /enum\s+(\w*)\s*\{(.*)\}/) {Ah the joy of regexes...
Applied, thanks.
Thanks!
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 10 lines · Andy Shevchenko
Quoted 9 lines · Jonathan Corbet
Quoted 6 lines · On Mon, 12 Aug 2019 19:06:31 +0300 Andy Shevchenko…
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!
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Support it in the kernel-doc script.
So I don't get this error; I guess the only anonymous enum of interest has yet to find its way into the mainline.
The other one is already in mainline (
drivers/remoteproc/omap_remoteproc.h), but suddenly it misses the second * in the header of kernel-doc comment (perhaps to avoid above error, or for another reason).
Actually more without full description
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h:186:
Or with format which messes name with description
drivers/misc/mic/cosm/cosm_main.h:19:include/linux/amba/pl022.h:166:
Or above variants together
drivers/pinctrl/pinctrl-rockchip.c:86:drivers/pinctrl/pinctrl-rockchip.c:98:
Noticed also broken references like
drivers/scsi/isci/port.c:1193:drivers/usb/host/ehci-timer.c:381:
where enum mentioned without leading &.
Signature · 2 lines
With Best Regards, Andy Shevchenko