Thread (14 messages) 14 messages, 2 authors, 2024-05-30

Re: [PATCH v3 7/9] staging: media: atmel: use for_each_endpoint_of_node()

flat view

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: 2024-05-30 23:41:59
Also in: dri-devel, linux-arm-kernel, linux-media, linux-omap, linux-staging

Hi Dan
quoted
-	while (1) {
+	for_each_endpoint_of_node(np, epn) {
 		struct v4l2_fwnode_endpoint v4l2_epn = { .bus_type = 0 };
 
-		epn = of_graph_get_next_endpoint(np, epn);
-		if (!epn)
-			return 0;
-
 		ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(epn),
 						 &v4l2_epn);
 		if (ret) {
This introduces a Smatch warning because now "ret" is uninitialized if
the for_each_endpoint_of_node() list is empty.  Is that something which
is possible?

I've been meaning to make a list of loops which always iterate at least
one time.  for_each_cpu() etc.
Oh, OK thank you for pointing it.
I will fixup and post it next week

Thank you for your help !!
Best regards
---
Kuninori Morimoto
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help