lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 23 Jul 2021 15:32:48 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Daniel Scally <djrscally@...il.com>
Cc:     linux-kernel@...r.kernel.org, gregkh@...uxfoundation.org,
        rafael@...nel.org, laurent.pinchart@...asonboard.com
Subject: Re: [PATCH 1/2] device property: Check fwnode->secondary in
 fwnode_graph_get_next_endpoint()

On Thu, Jul 22, 2021 at 09:19:28PM +0100, Daniel Scally wrote:
> Sensor drivers often check for an endpoint to make sure that they're
> connected to a consuming device like a CIO2 during .probe(). Some of
> those endpoints might be in the form of software_nodes assigned as
> a secondary to the device's fwnode_handle. Account for this possibility
> in fwnode_graph_get_next_endpoint() to avoid having to do it in the
> sensor drivers themselves.

...

> +	ep = fwnode_call_ptr_op(parent, graph_get_next_endpoint, prev);
> +
> +	if (IS_ERR_OR_NULL(ep) && !IS_ERR_OR_NULL(parent) &&
> +	    !IS_ERR_OR_NULL(parent->secondary))

Nit-pick, I would put it like:

	if (!IS_ERR_OR_NULL(parent->secondary) && !IS_ERR_OR_NULL(parent) &&
	    IS_ERR_OR_NULL(ep))

or

	if (IS_ERR_OR_NULL(ep) &&
	    !IS_ERR_OR_NULL(parent->secondary) && !IS_ERR_OR_NULL(parent))

for the sake of logical split.

> +		ep = fwnode_graph_get_next_endpoint(parent->secondary, NULL);

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists