All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: Ricardo Ribalda <ribalda@chromium.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Tiffany Lin <tiffany.lin@mediatek.com>,
	Andrew-CT Chen <andrew-ct.chen@mediatek.com>,
	Yunfei Dong <yunfei.dong@mediatek.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Hans Verkuil <hverkuil@xs4all.nl>,
	Kieran Bingham <kieran.bingham@ideasonboard.com>,
	Bin Liu <bin.liu@mediatek.com>,
	Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Stanimir Varbanov <stanimir.k.varbanov@gmail.com>,
	Vikash Garodia <quic_vgarodia@quicinc.com>,
	Bryan O 'Donoghue <bryan.odonoghue@linaro.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Alim Akhtar <alim.akhtar@samsung.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Bingbu Cao <bingbu.cao@intel.com>,
	Tianshu Qiu <tian.shu.qiu@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Kevin Hilman <khilman@baylibre.com>,
	Jerome Brunet <jbrunet@baylibre.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	linux-doc@vger.kernel.org
Subject: Re: [RFC 1/1] kernel-doc: Support arrays of pointers struct fields
Date: Sat, 27 Jan 2024 22:41:02 +0000	[thread overview]
Message-ID: <ZbWGfgHoZgDyXDNn@kekkonen.localdomain> (raw)
In-Reply-To: <aa94772b-7010-4bba-b099-d3b8fe1b97aa@infradead.org>

Hi Randy,

On Sat, Jan 27, 2024 at 01:01:01PM -0800, Randy Dunlap wrote:
> Hi Sakari,
> 
> On 1/27/24 10:53, Sakari Ailus wrote:
> > In a rather unusual arrangement in include/media/v4l2-vp9.h struct
> > v4l2_vp9_frame_symbol_counts has fields that are arrays of pointers, not a
> > pointer to an array, which is what's usually done.
> > 
> 
> Yet another kernel-doc bug. I have a list of 5 or 6 or 8 bugs that are
> similar to this one, but I didn't have this one.

:-)

Regular expressions are not best for parsing C. It seems to be doable in
practice but imperfect at the same time.

> 
> 
> > Add support for such arrays of pointers to kernel-doc.
> > 
> > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> 
> 
> Did this work for you?
> I still see the same warnings as before this patch is applied.

Hmm. How did you test this? I did:

	$ scripts/kernel-doc include/media/v4l2-vp9.h > /dev/null

Without this patch I do get a bunch of errors, with this patch there's no
output. The produced kernel-doc seemed to be fine, too (with the
redirection removed).

> 
> 
> > ---
> > Hi Ricardo,
> > 
> > I tried to ram it together with processing the rest but it seemed
> > to complicate processing the usual fields.
> > 
> >  scripts/kernel-doc | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> > 
> > diff --git a/scripts/kernel-doc b/scripts/kernel-doc
> > index e8aefd258a29..728b1ffc0478 100755
> > --- a/scripts/kernel-doc
> > +++ b/scripts/kernel-doc
> > @@ -1509,6 +1509,15 @@ sub create_parameterlist($$$$) {
> >  	    $type =~ s/([^\(]+\(\*?)\s*$param/$1/;
> >  	    save_struct_actual($param);
> >  	    push_parameter($param, $type, $arg, $file, $declaration_name);
> > +	} elsif ($arg =~ m/\(.+\)\s*\[/) {
> > +	    # array-of-pointers
> > +	    $arg =~ tr/#/,/;
> > +	    $arg =~ m/[^\(]+\(\s*\*\s*([\w\[\]\.]*?)\s*(\s*\[\s*[\w]+\s*\]\s*)*\)/;
> > +	    $param = $1;
> > +	    $type = $arg;
> > +	    $type =~ s/([^\(]+\(\*?)\s*$param/$1/;
> > +	    save_struct_actual($param);
> > +	    push_parameter($param, $type, $arg, $file, $declaration_name);
> >  	} elsif ($arg) {
> >  	    $arg =~ s/\s*:\s*/:/g;
> >  	    $arg =~ s/\s*\[/\[/g;
> 
> 
> Thanks.

-- 
Regards,

Sakari Ailus

  reply	other threads:[~2024-01-27 22:41 UTC|newest]

Thread overview: 200+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-26 23:15 [PATCH 00/17] media: kerneldoc warnings Ricardo Ribalda
2024-01-26 23:15 ` Ricardo Ribalda
2024-01-26 23:15 ` Ricardo Ribalda
2024-01-26 23:15 ` Ricardo Ribalda
2024-01-26 23:16 ` [PATCH 01/17] media: mediatek: vcodec: Fix " Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-27  1:38   ` Randy Dunlap
2024-01-27  1:38     ` Randy Dunlap
2024-01-27  1:38     ` Randy Dunlap
2024-01-27  1:38     ` Randy Dunlap
2024-01-29 10:08   ` AngeloGioacchino Del Regno
2024-01-29 10:08     ` AngeloGioacchino Del Regno
2024-01-29 10:08     ` AngeloGioacchino Del Regno
2024-01-29 10:08     ` AngeloGioacchino Del Regno
2024-01-26 23:16 ` [PATCH 02/17] media: videodev2.h: Fix kerneldoc Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-27  1:42   ` Randy Dunlap
2024-01-27  1:42     ` Randy Dunlap
2024-01-27  1:42     ` Randy Dunlap
2024-01-27  1:42     ` Randy Dunlap
2024-01-29 10:08   ` AngeloGioacchino Del Regno
2024-01-29 10:08     ` AngeloGioacchino Del Regno
2024-01-29 10:08     ` AngeloGioacchino Del Regno
2024-01-29 10:08     ` AngeloGioacchino Del Regno
2024-01-26 23:16 ` [PATCH 03/17] media: media-entity.h: " Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-27  1:51   ` Randy Dunlap
2024-01-27  1:51     ` Randy Dunlap
2024-01-27  1:51     ` Randy Dunlap
2024-01-27  1:51     ` Randy Dunlap
2024-01-27 18:40     ` Sakari Ailus
2024-01-27 18:40       ` Sakari Ailus
2024-01-27 18:40       ` Sakari Ailus
2024-01-27 18:40       ` Sakari Ailus
2024-01-27 20:50       ` Randy Dunlap
2024-01-27 20:50         ` Randy Dunlap
2024-01-27 20:50         ` Randy Dunlap
2024-01-27 20:50         ` Randy Dunlap
2024-01-27  9:48   ` Sakari Ailus
2024-01-27  9:48     ` Sakari Ailus
2024-01-27  9:48     ` Sakari Ailus
2024-01-27  9:48     ` Sakari Ailus
2024-01-26 23:16 ` [PATCH 04/17] media: cec.h: " Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-27 21:02   ` Randy Dunlap
2024-01-27 21:02     ` Randy Dunlap
2024-01-27 21:02     ` Randy Dunlap
2024-01-27 21:02     ` Randy Dunlap
2024-01-26 23:16 ` [PATCH 05/17] media: pci: dt315.h: " Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-27 21:03   ` Randy Dunlap
2024-01-27 21:03     ` Randy Dunlap
2024-01-27 21:03     ` Randy Dunlap
2024-01-27 21:03     ` Randy Dunlap
2024-01-26 23:16 ` [PATCH 06/17] media: i2c: css-quirk.h: " Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-27 22:00   ` Randy Dunlap
2024-01-27 22:00     ` Randy Dunlap
2024-01-27 22:00     ` Randy Dunlap
2024-01-27 22:00     ` Randy Dunlap
2024-01-26 23:16 ` [PATCH 07/17] media: i2c: adv748: " Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-27 22:02   ` Randy Dunlap
2024-01-27 22:02     ` Randy Dunlap
2024-01-27 22:02     ` Randy Dunlap
2024-01-27 22:02     ` Randy Dunlap
2024-01-28 11:01   ` Kieran Bingham
2024-01-28 11:01     ` Kieran Bingham
2024-01-28 11:01     ` Kieran Bingham
2024-01-28 11:01     ` Kieran Bingham
2024-01-26 23:16 ` [PATCH 08/17] media: mediatek: jpeg: " Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-27 22:03   ` Randy Dunlap
2024-01-27 22:03     ` Randy Dunlap
2024-01-27 22:03     ` Randy Dunlap
2024-01-27 22:03     ` Randy Dunlap
2024-01-29 10:08   ` AngeloGioacchino Del Regno
2024-01-29 10:08     ` AngeloGioacchino Del Regno
2024-01-29 10:08     ` AngeloGioacchino Del Regno
2024-01-29 10:08     ` AngeloGioacchino Del Regno
2024-01-26 23:16 ` [PATCH 09/17] media: mediatek: vcodec: " Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-27 22:07   ` Randy Dunlap
2024-01-27 22:07     ` Randy Dunlap
2024-01-27 22:07     ` Randy Dunlap
2024-01-27 22:07     ` Randy Dunlap
2024-01-29 10:08   ` AngeloGioacchino Del Regno
2024-01-29 10:08     ` AngeloGioacchino Del Regno
2024-01-29 10:08     ` AngeloGioacchino Del Regno
2024-01-29 10:08     ` AngeloGioacchino Del Regno
2024-01-26 23:16 ` [PATCH 10/17] media: verisilicon: " Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-27 22:09   ` Randy Dunlap
2024-01-27 22:09     ` Randy Dunlap
2024-01-27 22:09     ` Randy Dunlap
2024-01-27 22:09     ` Randy Dunlap
2024-01-26 23:16 ` [PATCH 11/17] media: qcom: venus: " Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-27 22:13   ` Randy Dunlap
2024-01-27 22:13     ` Randy Dunlap
2024-01-27 22:13     ` Randy Dunlap
2024-01-27 22:13     ` Randy Dunlap
2024-01-27 22:14     ` Randy Dunlap
2024-01-27 22:14       ` Randy Dunlap
2024-01-27 22:14       ` Randy Dunlap
2024-01-27 22:14       ` Randy Dunlap
2024-01-26 23:16 ` [PATCH 12/17] media: samsung: exynos4-is: " Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-27 22:16   ` Randy Dunlap
2024-01-27 22:16     ` Randy Dunlap
2024-01-27 22:16     ` Randy Dunlap
2024-01-27 22:16     ` Randy Dunlap
2024-01-26 23:16 ` [PATCH 13/17] media: samsung: s5p-mfc: " Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-27 22:17   ` Randy Dunlap
2024-01-27 22:17     ` Randy Dunlap
2024-01-27 22:17     ` Randy Dunlap
2024-01-27 22:17     ` Randy Dunlap
2024-01-26 23:16 ` [PATCH 14/17] media: dvb-usb: " Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-27 22:19   ` Randy Dunlap
2024-01-27 22:19     ` Randy Dunlap
2024-01-27 22:19     ` Randy Dunlap
2024-01-27 22:19     ` Randy Dunlap
2024-01-26 23:16 ` [PATCH 15/17] media: ipu3: " Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-27 22:22   ` Randy Dunlap
2024-01-27 22:22     ` Randy Dunlap
2024-01-27 22:22     ` Randy Dunlap
2024-01-27 22:22     ` Randy Dunlap
2024-01-26 23:16 ` [PATCH 16/17] media: staging: meson: " Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-27 22:23   ` Randy Dunlap
2024-01-27 22:23     ` Randy Dunlap
2024-01-27 22:23     ` Randy Dunlap
2024-01-27 22:23     ` Randy Dunlap
2024-01-26 23:16 ` [PATCH 17/17] linux: v4l2-vp9.h: " Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-26 23:16   ` Ricardo Ribalda
2024-01-27  9:57   ` Sakari Ailus
2024-01-27  9:57     ` Sakari Ailus
2024-01-27  9:57     ` Sakari Ailus
2024-01-27  9:57     ` Sakari Ailus
2024-02-05 10:29     ` Hans Verkuil
2024-02-05 10:29       ` Hans Verkuil
2024-02-05 10:29       ` Hans Verkuil
2024-02-05 10:29       ` Hans Verkuil
2024-02-05 10:39       ` Randy Dunlap
2024-02-05 10:39         ` Randy Dunlap
2024-02-05 10:39         ` Randy Dunlap
2024-02-05 10:39         ` Randy Dunlap
2024-02-05 10:44         ` Hans Verkuil
2024-02-05 10:44           ` Hans Verkuil
2024-02-05 10:44           ` Hans Verkuil
2024-02-05 10:44           ` Hans Verkuil
2024-02-05 10:53           ` Sakari Ailus
2024-02-05 10:53             ` Sakari Ailus
2024-02-05 10:53             ` Sakari Ailus
2024-02-05 10:53             ` Sakari Ailus
2024-01-27 18:53   ` [RFC 1/1] kernel-doc: Support arrays of pointers struct fields Sakari Ailus
2024-01-27 21:01     ` Randy Dunlap
2024-01-27 22:41       ` Sakari Ailus [this message]
2024-01-27 22:55         ` Randy Dunlap
2024-01-30 17:19     ` Ricardo Ribalda
2024-01-30 21:10     ` Jonathan Corbet
2024-01-30 21:31       ` Ricardo Ribalda
2024-01-30 21:54         ` Jonathan Corbet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZbWGfgHoZgDyXDNn@kekkonen.localdomain \
    --to=sakari.ailus@linux.intel.com \
    --cc=alim.akhtar@samsung.com \
    --cc=andersson@kernel.org \
    --cc=andrew-ct.chen@mediatek.com \
    --cc=andrzej.hajda@intel.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=bin.liu@mediatek.com \
    --cc=bingbu.cao@intel.com \
    --cc=bryan.odonoghue@linaro.org \
    --cc=corbet@lwn.net \
    --cc=ezequiel@vanguardiasur.com.ar \
    --cc=gregkh@linuxfoundation.org \
    --cc=hverkuil@xs4all.nl \
    --cc=jbrunet@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=matthias.bgg@gmail.com \
    --cc=mchehab@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=p.zabel@pengutronix.de \
    --cc=quic_vgarodia@quicinc.com \
    --cc=rdunlap@infradead.org \
    --cc=ribalda@chromium.org \
    --cc=s.nawrocki@samsung.com \
    --cc=stanimir.k.varbanov@gmail.com \
    --cc=tian.shu.qiu@intel.com \
    --cc=tiffany.lin@mediatek.com \
    --cc=yunfei.dong@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.