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

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Thu May 30 16:41:55 PDT 2024


Hi Dan

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



More information about the linux-arm-kernel mailing list