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: <CAL_JsqKy7qWDkU3z1p0oTn1umLzWchKw86Zu8mKzugDWQXJF-w@mail.gmail.com>
Date:   Tue, 14 Mar 2023 08:23:46 -0500
From:   Rob Herring <robh@...nel.org>
To:     Michal Simek <michal.simek@....com>
Cc:     Michal Simek <michal.simek@...inx.com>, devicetree@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] soc: xilinx: Use of_property_present() for testing DT
 property presence

On Mon, Mar 13, 2023 at 5:19 AM Michal Simek <michal.simek@....com> wrote:
>
>
>
> On 3/10/23 15:47, Rob Herring wrote:
> > It is preferred to use typed property access functions (i.e.
> > of_property_read_<type> functions) rather than low-level
> > of_get_property/of_find_property functions for reading properties. As
> > part of this, convert of_get_property/of_find_property calls to the
> > recently added of_property_present() helper when we just want to test
> > for presence of a property and nothing more.
> >
> > Signed-off-by: Rob Herring <robh@...nel.org>
> > ---
> >   drivers/soc/xilinx/zynqmp_power.c | 4 ++--
> >   1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/soc/xilinx/zynqmp_power.c b/drivers/soc/xilinx/zynqmp_power.c
> > index 78a8a7545d1e..641dcc958911 100644
> > --- a/drivers/soc/xilinx/zynqmp_power.c
> > +++ b/drivers/soc/xilinx/zynqmp_power.c
> > @@ -218,7 +218,7 @@ static int zynqmp_pm_probe(struct platform_device *pdev)
> >          } else if (ret != -EACCES && ret != -ENODEV) {
> >                  dev_err(&pdev->dev, "Failed to Register with Xilinx Event manager %d\n", ret);
> >                  return ret;
> > -       } else if (of_find_property(pdev->dev.of_node, "mboxes", NULL)) {
> > +       } else if (of_property_present(pdev->dev.of_node, "mboxes")) {
> >                  zynqmp_pm_init_suspend_work =
> >                          devm_kzalloc(&pdev->dev,
> >                                       sizeof(struct zynqmp_pm_work_struct),
> > @@ -240,7 +240,7 @@ static int zynqmp_pm_probe(struct platform_device *pdev)
> >                          dev_err(&pdev->dev, "Failed to request rx channel\n");
> >                          return PTR_ERR(rx_chan);
> >                  }
> > -       } else if (of_find_property(pdev->dev.of_node, "interrupts", NULL)) {
> > +       } else if (of_property_present(pdev->dev.of_node, "interrupts")) {
> >                  irq = platform_get_irq(pdev, 0);
> >                  if (irq <= 0)
> >                          return -ENXIO;
> > --
> > 2.39.2
> >
>
> Waiting for v2 because of missing of.h header reported by lkp.
> https://lore.kernel.org/all/202303120017.BIw01Y21-lkp@intel.com/

It's a false positive. The header change is in v6.3-rc1, but 0-day is
applying these to branches not yet updated to rc1.

Rob

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ