linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] kernel-doc: Support arrays of pointers struct fields
@ 2024-01-31  8:49 Sakari Ailus
  2024-02-05 17:04 ` Jonathan Corbet
  0 siblings, 1 reply; 13+ messages in thread
From: Sakari Ailus @ 2024-01-31  8:49 UTC (permalink / raw)
  To: Jonathan Corbet, linux-doc
  Cc: Ricardo Ribalda, Sakari Ailus, Tiffany Lin, Andrew-CT Chen,
	Yunfei Dong, Mauro Carvalho Chehab, Matthias Brugger,
	AngeloGioacchino Del Regno, Laurent Pinchart, Hans Verkuil,
	Kieran Bingham, Bin Liu, Ezequiel Garcia, Philipp Zabel,
	Stanimir Varbanov, Vikash Garodia, Bryan O'Donoghue,
	Bjorn Andersson, Konrad Dybcio, Sylwester Nawrocki,
	Krzysztof Kozlowski, Alim Akhtar, Marek Szyprowski, Andrzej Hajda,
	Bingbu Cao, Tianshu Qiu, Greg Kroah-Hartman, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl

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) {
 	    $arg =~ s/\s*:\s*/:/g;
 	    $arg =~ s/\s*\[/\[/g;
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-02-14 16:38 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).