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: <CAJZ5v0ivSmgAbfH9JhGHRp9411F14XtrimESHftZGMLYKLfKmQ@mail.gmail.com>
Date:   Wed, 20 Jan 2021 20:12:26 +0100
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     "Rafael J. Wysocki" <rafael@...nel.org>,
        Calvin Johnson <calvin.johnson@....nxp.com>,
        Grant Likely <grant.likely@....com>,
        Jeremy Linton <jeremy.linton@....com>,
        Andrew Lunn <andrew@...n.ch>,
        Florian Fainelli <f.fainelli@...il.com>,
        Russell King - ARM Linux admin <linux@...linux.org.uk>,
        Cristi Sovaiala <cristian.sovaiala@....com>,
        Florin Laurentiu Chiculita <florinlaurentiu.chiculita@....com>,
        Ioana Ciornei <ioana.ciornei@....com>,
        Madalin Bucur <madalin.bucur@....nxp.com>,
        Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
        Marcin Wojtas <mw@...ihalf.com>,
        Pieter Jansen Van Vuuren <pieter.jansenvv@...boosystems.io>,
        Jon <jon@...id-run.com>,
        Diana Madalina Craciun <diana.craciun@....com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        netdev <netdev@...r.kernel.org>,
        Laurentiu Tudor <laurentiu.tudor@....com>,
        ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
        "linux.cj" <linux.cj@...il.com>,
        linux-arm Mailing List <linux-arm-kernel@...ts.infradead.org>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Bartosz Golaszewski <bgolaszewski@...libre.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Laurent Pinchart <laurent.pinchart+renesas@...asonboard.com>,
        Randy Dunlap <rdunlap@...radead.org>,
        Saravana Kannan <saravanak@...gle.com>
Subject: Re: [net-next PATCH v3 09/15] device property: Introduce fwnode_get_id()

On Wed, Jan 20, 2021 at 7:44 PM Andy Shevchenko
<andy.shevchenko@...il.com> wrote:
>
> On Wed, Jan 20, 2021 at 8:18 PM Rafael J. Wysocki <rafael@...nel.org> wrote:
> > On Tue, Jan 12, 2021 at 4:47 PM Andy Shevchenko
> > <andy.shevchenko@...il.com> wrote:
> > > On Tue, Jan 12, 2021 at 3:42 PM Calvin Johnson
> > > <calvin.johnson@....nxp.com> wrote:
>
> ...
>
> > > > +int fwnode_get_id(struct fwnode_handle *fwnode, u32 *id)
> > > > +{
> > > > +#ifdef CONFIG_ACPI
> > > > +       unsigned long long adr;
> > > > +       acpi_status status;
> > > > +#endif
> > > > +       int ret;
> > > > +
> > > > +       ret = fwnode_property_read_u32(fwnode, "reg", id);
> > > > +       if (!(ret && is_acpi_node(fwnode)))
> > > > +               return ret;
> > > > +
> > > > +#ifdef CONFIG_ACPI
> > > > +       status = acpi_evaluate_integer(ACPI_HANDLE_FWNODE(fwnode),
> > > > +                                      METHOD_NAME__ADR, NULL, &adr);
> > > > +       if (ACPI_FAILURE(status))
> > > > +               return -EINVAL;
> > > > +       *id = (u32)adr;
> > >
> > > Shouldn't be
> > >
> > >        return 0;
> > > #else
> > >        return -EINVAL;
> > > #endif
> > >
> > > ?
> > >
> > > Yes, it's a theoretical case when is_acpi_node() returns true when
> > > CONFIG_ACPI=n.
> >
> > How so?  is_acpi_node() is defined as a static inline returning false then.
>
> I understand that, that's why it's pure theoretical when, for example,
> the semantics is changed. But I believe it's unlucky to happen.

Changing the definition of it for CONFIG_ACPI=n would be a regression
given the current usage of it.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ