On Tue, Nov 30, 2021 at 05:32:48PM +0200, Sakari Ailus wrote: > Add fwnode_graph_get_endpoint_count() function to provide generic > implementation of of_graph_get_endpoint_count(). The former by default > only counts endpoints to available devices which is consistent with the > rest of the fwnode graph API. By providing FWNODE_GRAPH_DEVICE_DISABLED > flag, also unconnected endpoints and endpoints to disabled devices are > counted. ... > + fwnode_graph_for_each_endpoint(fwnode, ep) { > + if (!(flags & FWNODE_GRAPH_DEVICE_DISABLED) && > + !fwnode_graph_remote_available(ep)) > + continue; > + count++; Can't it be more straightforward to write it as if (flags & FWNODE_GRAPH_DEVICE_DISABLED || fwnode_graph_remote_available(ep)) count++; ? > + } -- With Best Regards, Andy Shevchenko