From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Jonathan Corbet <corbet@lwn.net>
Cc: linux-doc@vger.kernel.org, Ricardo Ribalda <ribalda@chromium.org>,
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>
Subject: Re: [PATCH 1/1] kernel-doc: Support arrays of pointers struct fields
Date: Mon, 5 Feb 2024 21:30:34 +0000 [thread overview]
Message-ID: <ZcFTepqR7xBFAMTM@kekkonen.localdomain> (raw)
In-Reply-To: <87y1byvo4t.fsf@meer.lwn.net>
Hi Jon,
On Mon, Feb 05, 2024 at 10:04:18AM -0700, Jonathan Corbet wrote:
> Sakari Ailus <sakari.ailus@linux.intel.com> writes:
>
> > 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.
> >
> > Add support for such arrays of pointers to kernel-doc.
> >
> > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> > Acked-by: Randy Dunlap <rdunlap@infradead.org>
> > Tested-by: Randy Dunlap <rdunlap@infradead.org>
> > Tested-by: Ricardo Ribalda <ribalda@chromium.org>
> > ---
> > No change since the RFC, just added the acks.
> >
> > scripts/kernel-doc | 9 +++++++++
> > 1 file changed, 9 insertions(+)
> >
> > diff --git a/scripts/kernel-doc b/scripts/kernel-doc
> > index e8aefd258a29..23c91b11585a 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) {
>
> Sigh ... seeing more indecipherable regexes added to kernel-doc is like
> seeing another load of plastic bags dumped into the ocean... it doesn't
> change the basic situation, but it's still sad.
>
> Oh well, applied, thanks.
Thanks. I have to say I feel the same...
Regexes aren't great for parsing C, that's for sure. :-I But what are the
options? Write a proper parser for (a subset of) C?
--
Regards,
Sakari Ailus
next prev parent reply other threads:[~2024-02-05 22:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-31 8:49 [PATCH 1/1] kernel-doc: Support arrays of pointers struct fields Sakari Ailus
2024-02-05 17:04 ` Jonathan Corbet
2024-02-05 21:30 ` Sakari Ailus [this message]
2024-02-06 0:05 ` Jonathan Corbet
2024-02-06 3:50 ` scripts/kernel-doc parsing issues Randy Dunlap
2025-02-14 3:15 ` Randy Dunlap
2025-02-14 7:57 ` Mauro Carvalho Chehab
2024-02-06 11:20 ` [PATCH 1/1] kernel-doc: Support arrays of pointers struct fields Jani Nikula
2024-02-06 15:13 ` Jonathan Corbet
2025-02-14 7:45 ` Mauro Carvalho Chehab
2025-02-14 15:56 ` Jonathan Corbet
2025-02-14 16:29 ` Jani Nikula
2025-02-14 16:38 ` 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=ZcFTepqR7xBFAMTM@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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).