* [PATCH v1] kernel-doc: Allow anonymous enum
@ 2019-08-12 16:06 Andy Shevchenko
2019-08-12 21:13 ` Jonathan Corbet
0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2019-08-12 16:06 UTC (permalink / raw)
To: Jonathan Corbet, linux-doc, Mika Westerberg, Linus Walleij
Cc: 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.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
scripts/kernel-doc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 6b03012750da..079502bcc5a3 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -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;
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v1] kernel-doc: Allow anonymous enum
2019-08-12 16:06 [PATCH v1] kernel-doc: Allow anonymous enum Andy Shevchenko
@ 2019-08-12 21:13 ` Jonathan Corbet
2019-08-13 12:19 ` Andy Shevchenko
0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Corbet @ 2019-08-12 21:13 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: linux-doc, Mika Westerberg, Linus Walleij
On Mon, 12 Aug 2019 19:06:31 +0300
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> 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.
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> scripts/kernel-doc | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/kernel-doc b/scripts/kernel-doc
> index 6b03012750da..079502bcc5a3 100755
> --- a/scripts/kernel-doc
> +++ b/scripts/kernel-doc
> @@ -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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] kernel-doc: Allow anonymous enum
2019-08-12 21:13 ` Jonathan Corbet
@ 2019-08-13 12:19 ` Andy Shevchenko
2019-08-13 12:31 ` Andy Shevchenko
0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2019-08-13 12:19 UTC (permalink / raw)
To: Jonathan Corbet; +Cc: linux-doc, Mika Westerberg, Linus Walleij
On Mon, Aug 12, 2019 at 03:13:17PM -0600, Jonathan Corbet wrote:
> On Mon, 12 Aug 2019 19:06:31 +0300
> Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
>
> > 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.
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).
>
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
> > scripts/kernel-doc | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/scripts/kernel-doc b/scripts/kernel-doc
> > index 6b03012750da..079502bcc5a3 100755
> > --- a/scripts/kernel-doc
> > +++ b/scripts/kernel-doc
> > @@ -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.
Thanks!
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] kernel-doc: Allow anonymous enum
2019-08-13 12:19 ` Andy Shevchenko
@ 2019-08-13 12:31 ` Andy Shevchenko
0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2019-08-13 12:31 UTC (permalink / raw)
To: Jonathan Corbet; +Cc: linux-doc, Mika Westerberg, Linus Walleij
On Tue, Aug 13, 2019 at 03:19:12PM +0300, Andy Shevchenko wrote:
> On Mon, Aug 12, 2019 at 03:13:17PM -0600, Jonathan Corbet wrote:
> > On Mon, 12 Aug 2019 19:06:31 +0300
> > Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> >
> > > 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.
>
> 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 &.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-08-13 12:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-12 16:06 [PATCH v1] kernel-doc: Allow anonymous enum Andy Shevchenko
2019-08-12 21:13 ` Jonathan Corbet
2019-08-13 12:19 ` Andy Shevchenko
2019-08-13 12:31 ` Andy Shevchenko
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.