Re: [PATCH 5/7] device property: Implement fwnode_graph_get_endpoint_count()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux