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  linux-cve-announce  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]
Message-ID: <Y20zvUeRvnVPtUs+@google.com>
Date:   Thu, 10 Nov 2022 09:24:13 -0800
From:   Dmitry Torokhov <dmitry.torokhov@...il.com>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     Linus Walleij <linus.walleij@...aro.org>,
        Bartosz Golaszewski <brgl@...ev.pl>,
        linux-kernel@...r.kernel.org, linux-acpi@...r.kernel.org,
        linux-gpio@...r.kernel.org
Subject: Re: [PATCH v3 5/6] gpiolib: consolidate GPIO lookups

On Thu, Nov 10, 2022 at 04:13:57PM +0200, Andy Shevchenko wrote:
> On Wed, Nov 09, 2022 at 11:30:43AM -0800, Dmitry Torokhov wrote:
> > Ensure that all paths to obtain/look up GPIOD from generic
> > consumer-visible APIs go through the new gpiod_find_and_request()
> > helper, so that we can easily extend it with support for new firmware
> > mechanisms.
> > 
> > The only exception is OF-specific [devm_]gpiod_get_from_of_node() API
> > that is still being used by a couple of drivers and will be removed as
> > soon as patches converting them to use generic fwnode/device APIs are
> > accepted.
> 
> ...
> 
> > +	if (!IS_ERR_OR_NULL(fwnode))
> 
> As pointed earlier I still think this is not needed. Even for the sake of
> showing an intent, the not-found fwnode(i.e. GPIO), will be handled anyway...
> 
> > +		desc = gpiod_find_by_fwnode(fwnode, consumer, con_id, idx,
> > +					    &flags, &lookupflags);
> > +
> > +	if (gpiod_not_found(desc) && platform_lookup_allowed) {
> 
> ...here by gpiod_not_found() which is an exact intention in both cases above
> (fwnode is not provided / invalid or GPIO wasn't found).

Thank you for the thorough reviews.

I think at this point I will leave to to Bart and Linus to decide what
form they prefer here. From the execution point there is no practical
difference, it is all syntactic sugar.

Thanks.

-- 
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ