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] [day] [month] [year] [list]
Date:   Fri, 24 Feb 2023 20:16:21 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Asmaa Mnebhi <asmaa@...dia.com>
Cc:     linus.walleij@...aro.org, linux-gpio@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] gpio: mmio: handle "ngpios" properly in bgpio_init

On Fri, Feb 24, 2023 at 7:40 PM Asmaa Mnebhi <asmaa@...dia.com> wrote:
>
> bgpio_init uses "sz" argument to populate ngpio, which is not accurate.

bgpio_init() uses the

(Note parentheses, same for other func() mentions)

> Instead, read the "ngpios" property from the DT and if it
> doesn't exist, use the "sz" argument. With this change, drivers no
> longer need to overwrite the ngpio variable after calling bgpio_init.

Thank you!

...

> +       ret = device_property_read_u32(dev, "ngpios", &ngpios);
> +       if (!ret)
> +               gc->ngpio = ngpios;
> +       else
> +               gc->ngpio = gc->bgpio_bits;

This duplicates the GPIO library. What probably better to have is to
just check the property existence

device_property_present() and do accordingly.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ