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: <CAHp75VfyPQGXT9ypp+SducvHwOgMpCm-rCXSrQ=9-MCH8b+ZLw@mail.gmail.com>
Date: Fri, 23 Aug 2024 16:17:19 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: linux-renesas-soc@...r.kernel.org, linux-gpio@...r.kernel.org, 
	linux-kernel@...r.kernel.org, Linus Walleij <linus.walleij@...aro.org>, 
	"Lad, Prabhakar" <prabhakar.mahadev-lad.rj@...renesas.com>
Subject: Re: [PATCH v1 1/1] pinctrl: renesas: rzg2l: Replace
 of_node_to_fwnode() with more suitable API

On Fri, Aug 23, 2024 at 10:23 AM Geert Uytterhoeven
<geert@...ux-m68k.org> wrote:
> On Fri, Aug 23, 2024 at 1:01 AM Andy Shevchenko
> <andy.shevchenko@...il.com> wrote:
> > of_node_to_fwnode() is a IRQ domain specific implementation of
> > of_fwnode_handle(). Replace the former with more suitable API.

...

> > -       girq->fwnode = of_node_to_fwnode(np);
> > +       girq->fwnode = dev_fwnode(pctrl->dev);
>
> While this looks correct, the new call goes through many more hoops, and
> is not a simple inline function.

Maybe, but it's not a hot path anyway.

> Perhaps just &np->fwnode? ;-)

Definitely not for a couple of reasons:
- the explicit dereferencing may prevent from easier cleaning up and
moving the fwnode members around in the driver core
- the GPIO library internally doesn't use OF node directly, so the
code that call GPIO library would be better to follow that

Additionally one can call of_fwnode_handle(), but going here and there
with it makes no sense as it much cleaner to see that this fwnode
comes directly from the device. This is not obvious from the original
or any code that uses np.

After all the idea at minimum to isolate of_node_to_fwnode() from all,
but native IRQ chips (basically there are two big users: native IRQ
chips and PCI MSI).

P.S. Also note, it's _the only_ pin control driver that uses that API.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ