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: <20230306204012.dgfqczwcwh2hkbii@mobilestation>
Date:   Mon, 6 Mar 2023 23:40:12 +0300
From:   Serge Semin <fancer.lancer@...il.com>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Brad Larson <blarson@....com>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        linux-mmc@...r.kernel.org, linux-spi@...r.kernel.org,
        adrian.hunter@...el.com, alcooperx@...il.com, arnd@...db.de,
        brendan.higgins@...ux.dev, briannorris@...omium.org,
        brijeshkumar.singh@....com, catalin.marinas@....com,
        davidgow@...gle.com, gsomlo@...il.com, gerg@...ux-m68k.org,
        krzk@...nel.org, krzysztof.kozlowski+dt@...aro.org, lee@...nel.org,
        lee.jones@...aro.org, broonie@...nel.org,
        yamada.masahiro@...ionext.com, p.zabel@...gutronix.de,
        piotrs@...ence.com, p.yadav@...com, rdunlap@...radead.org,
        robh+dt@...nel.org, samuel@...lland.org, skhan@...uxfoundation.org,
        suravee.suthikulpanit@....com, thomas.lendacky@....com,
        tonyhuang.sunplus@...il.com, ulf.hansson@...aro.org,
        vaishnav.a@...com, will@...nel.org, devicetree@...r.kernel.org
Subject: Re: [PATCH v10 10/15] spi: dw: Add support for AMD Pensando Elba SoC

On Mon, Mar 06, 2023 at 09:59:29PM +0200, Andy Shevchenko wrote:
> On Mon, Mar 6, 2023 at 6:00 PM Serge Semin <fancer.lancer@...il.com> wrote:
> > On Sun, Mar 05, 2023 at 08:07:34PM -0800, Brad Larson wrote:
> 
> ...
> 
> > > -     node = of_parse_phandle(np, syscon_name, 0);
> >
> >         node = of_parse_phandle(dev_of_node(pdev->dev), syscon_name, 0);
> 

> Side note: I would rather see syscon_fwnode_to_regmap() instead of
> this. And IIRC syscon already has an API to find by name.

Ah, right. Though it's called syscon_regmap_lookup_by_phandle() and it
can be used to replace the entire pattern: "Parse property; Find node
by phandle; Get regmap by node". Basically the of_parse_phandle() and
syscon_node_to_regmap() methods invocation can be replaced with just a
single function call. Thus there won't be need to worry about
decrementing the found DT-node ref-counter.

> 
> > > +     if (!node)
> >
> > > +             return dev_err_probe(&pdev->dev, -ENODEV, "failed to find %s\n",
> > > +                                  syscon_name);
> >
> > Hm, using dev_err_probe() with known error value seems overkill.
> 

> It's allowed use and it helps to drop a few unnecessary lines of code.

Ok, seeing there is no alternative to that method which would return
the passed error but wouldn't have a name implying the silent
deferred-probe error semantics.

-Serge(y)

> 
> > > +     syscon = syscon_node_to_regmap(node);
> > > +     if (IS_ERR(syscon))
> > > +             return dev_err_probe(&pdev->dev, PTR_ERR(syscon),
> > > +                                  "syscon regmap lookup failed\n");
> 
> -- 
> With Best Regards,
> Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ