[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJZ5v0h+NMOPaTBSJEt0boWd2=g6umqAuq4buy7vL+mz=-jusw@mail.gmail.com>
Date: Thu, 25 Aug 2022 09:47:54 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Sakari Ailus <sakari.ailus@...ux.intel.com>
Cc: Ard Biesheuvel <ardb@...nel.org>,
Stefan Binding <sbinding@...nsource.cirrus.com>,
"Shevchenko, Andriy" <andriy.shevchenko@...el.com>,
ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
patches@...nsource.cirrus.com,
"Rafael J. Wysocki" <rafael@...nel.org>
Subject: Re: [PATCH v1] ACPI: Property: Fix type detection of unified integer
reading functions
On Thu, Aug 25, 2022 at 9:45 AM Sakari Ailus
<sakari.ailus@...ux.intel.com> wrote:
>
> Hi Ard,
>
> On Thu, Aug 25, 2022 at 09:25:05AM +0200, Ard Biesheuvel wrote:
> > > The current code expects the type of the value to be an integer type,
> > > instead the value passed to the macro is a pointer.
> > > Ensure the size comparison uses the correct pointer type to choose the
> > > max value, instead of using the integer type.
> > >
> > > Fixes: 923044133367 ("ACPI: property: Unify integer value reading functions")
> > >
> > > Signed-off-by: Stefan Binding <sbinding@...nsource.cirrus.com>
> >
> > Acked-by: Ard Biesheuvel <ardb@...nel.org>
> >
> > Can we get this queued up and sent out please? This is breaking some ACPI arm64
> > systems, which use device properties for their MAC addresses.
> >
> > Some grumbling about the original patch below.
> >
> > > ---
> > > drivers/acpi/property.c | 8 ++++----
> > > 1 file changed, 4 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
> > > index 7b3ad8ed2f4e..b1d4a8db89df 100644
> > > --- a/drivers/acpi/property.c
> > > +++ b/drivers/acpi/property.c
> > > @@ -1043,10 +1043,10 @@ static int acpi_data_prop_read_single(const struct acpi_device_data *data,
> > > break; \
> > > } \
> > > if (__items[i].integer.value > _Generic(__val, \
> > > - u8: U8_MAX, \
> > > - u16: U16_MAX, \
> > > - u32: U32_MAX, \
> > > - u64: U64_MAX, \
> > > + u8 *: U8_MAX, \
> > > + u16 *: U16_MAX, \
> > > + u32 *: U32_MAX, \
> > > + u64 *: U64_MAX, \
> > > default: 0U)) { \
> >
> > Why is there a default here? Having one is what hides the fact that the patch was completely broken.
>
> I think the default can be removed. I can send a patch.
Please do.
Powered by blists - more mailing lists