mbox series

[v1,0/8] ACPI: unify _UID handling as integer

Message ID 20220907164606.65742-1-andriy.shevchenko@linux.intel.com
Headers show
Series ACPI: unify _UID handling as integer | expand

Message

Andy Shevchenko Sept. 7, 2022, 4:45 p.m. UTC
This series is about unification on how we handle ACPI _UID when
it's known to be an integer-in-the-string.

The idea of merging either all via ACPI tree, or (which I prefer)
taking ACPI stuff for v6.1 while the rest may be picked up later
on by respective maintainers separately.

Partially compile-tested (x86-64).

Andy Shevchenko (8):
  ACPI: utils: Add acpi_dev_uid_to_integer() helper to get _UID as
    integer
  ACPI: LPSS: Refactor _UID handling to use acpi_dev_uid_to_integer()
  ACPI: x86: Refactor _UID handling to use acpi_dev_uid_to_integer()
  i2c: amd-mp2-plat: Refactor _UID handling to use
    acpi_dev_uid_to_integer()
  i2c: mlxbf: Refactor _UID handling to use acpi_dev_uid_to_integer()
  perf: qcom_l2_pmu: Refactor _UID handling to use
    acpi_dev_uid_to_integer()
  spi: pxa2xx: Refactor _UID handling to use acpi_dev_uid_to_integer()
  efi/dev-path-parser: Refactor _UID handling to use
    acpi_dev_uid_to_integer()

 drivers/acpi/acpi_lpss.c               | 15 ++++++------
 drivers/acpi/utils.c                   | 24 ++++++++++++++++++
 drivers/acpi/x86/utils.c               | 14 ++++++++---
 drivers/firmware/efi/dev-path-parser.c | 10 +++++---
 drivers/i2c/busses/i2c-amd-mp2-plat.c  | 27 +++++++-------------
 drivers/i2c/busses/i2c-mlxbf.c         | 19 +++++---------
 drivers/perf/qcom_l2_pmu.c             |  7 +++---
 drivers/spi/spi-pxa2xx.c               | 34 +++++++-------------------
 include/acpi/acpi_bus.h                |  1 +
 include/linux/acpi.h                   |  5 ++++
 10 files changed, 81 insertions(+), 75 deletions(-)

Comments

Hans de Goede Sept. 8, 2022, 9:28 a.m. UTC | #1
Hi,

On 9/7/22 18:45, Andy Shevchenko wrote:
> This series is about unification on how we handle ACPI _UID when
> it's known to be an integer-in-the-string.
> 
> The idea of merging either all via ACPI tree, or (which I prefer)
> taking ACPI stuff for v6.1 while the rest may be picked up later
> on by respective maintainers separately.
> 
> Partially compile-tested (x86-64).
> 
> Andy Shevchenko (8):
>   ACPI: utils: Add acpi_dev_uid_to_integer() helper to get _UID as
>     integer
>   ACPI: LPSS: Refactor _UID handling to use acpi_dev_uid_to_integer()
>   ACPI: x86: Refactor _UID handling to use acpi_dev_uid_to_integer()
>   i2c: amd-mp2-plat: Refactor _UID handling to use
>     acpi_dev_uid_to_integer()
>   i2c: mlxbf: Refactor _UID handling to use acpi_dev_uid_to_integer()
>   perf: qcom_l2_pmu: Refactor _UID handling to use
>     acpi_dev_uid_to_integer()
>   spi: pxa2xx: Refactor _UID handling to use acpi_dev_uid_to_integer()
>   efi/dev-path-parser: Refactor _UID handling to use
>     acpi_dev_uid_to_integer()
> 
>  drivers/acpi/acpi_lpss.c               | 15 ++++++------
>  drivers/acpi/utils.c                   | 24 ++++++++++++++++++
>  drivers/acpi/x86/utils.c               | 14 ++++++++---
>  drivers/firmware/efi/dev-path-parser.c | 10 +++++---
>  drivers/i2c/busses/i2c-amd-mp2-plat.c  | 27 +++++++-------------
>  drivers/i2c/busses/i2c-mlxbf.c         | 19 +++++---------
>  drivers/perf/qcom_l2_pmu.c             |  7 +++---
>  drivers/spi/spi-pxa2xx.c               | 34 +++++++-------------------
>  include/acpi/acpi_bus.h                |  1 +
>  include/linux/acpi.h                   |  5 ++++
>  10 files changed, 81 insertions(+), 75 deletions(-)
> 

Thanks, patches 1-7 look good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

for patches 1-7.

I have one small remark for patch 8, which I will send in
a reply to patch 8.

Regards,

Hans
Andy Shevchenko Sept. 8, 2022, 10:06 a.m. UTC | #2
On Thu, Sep 08, 2022 at 10:20:47AM +0200, Ard Biesheuvel wrote:
> On Wed, 7 Sept 2022 at 18:57, Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:

...

> >         for_each_acpi_dev_match(adev, hid, NULL, -1) {
> > -               if (adev->pnp.unique_id && !strcmp(adev->pnp.unique_id, uid))
> > +               ret = acpi_dev_uid_to_integer(adev, &uid);
> > +               if (ret == -ENODATA && node->acpi.uid == 0)
> >                         break;
> > -               if (!adev->pnp.unique_id && node->acpi.uid == 0)
> > +               if (ret == 0 && node->acpi.uid == uid)
> 
> Is it necessary to reorder the conditions here? I.e., why not

Code-wise there should be not much difference which does not affect the flow,
I think I moved it to be closer to the pattern "let's handle errors first",
but in this case I'm fine with your proposal.

> > +               ret = acpi_dev_uid_to_integer(adev, &uid);
> > +               if (ret == 0 && node->acpi.uid == uid)
> >                         break;
> > +               if (ret == -ENODATA && node->acpi.uid == 0)
> >                         break;
> 
> ?
> 
> With that fixed,
> 
> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>

Thanks!
Andy Shevchenko Sept. 8, 2022, 10:06 a.m. UTC | #3
On Thu, Sep 08, 2022 at 11:28:48AM +0200, Hans de Goede wrote:
> On 9/7/22 18:45, Andy Shevchenko wrote:
> > This series is about unification on how we handle ACPI _UID when
> > it's known to be an integer-in-the-string.
> > 
> > The idea of merging either all via ACPI tree, or (which I prefer)
> > taking ACPI stuff for v6.1 while the rest may be picked up later
> > on by respective maintainers separately.
> > 
> > Partially compile-tested (x86-64).
> > 
> > Andy Shevchenko (8):
> >   ACPI: utils: Add acpi_dev_uid_to_integer() helper to get _UID as
> >     integer
> >   ACPI: LPSS: Refactor _UID handling to use acpi_dev_uid_to_integer()
> >   ACPI: x86: Refactor _UID handling to use acpi_dev_uid_to_integer()
> >   i2c: amd-mp2-plat: Refactor _UID handling to use
> >     acpi_dev_uid_to_integer()
> >   i2c: mlxbf: Refactor _UID handling to use acpi_dev_uid_to_integer()
> >   perf: qcom_l2_pmu: Refactor _UID handling to use
> >     acpi_dev_uid_to_integer()
> >   spi: pxa2xx: Refactor _UID handling to use acpi_dev_uid_to_integer()
> >   efi/dev-path-parser: Refactor _UID handling to use
> >     acpi_dev_uid_to_integer()
> > 
> >  drivers/acpi/acpi_lpss.c               | 15 ++++++------
> >  drivers/acpi/utils.c                   | 24 ++++++++++++++++++
> >  drivers/acpi/x86/utils.c               | 14 ++++++++---
> >  drivers/firmware/efi/dev-path-parser.c | 10 +++++---
> >  drivers/i2c/busses/i2c-amd-mp2-plat.c  | 27 +++++++-------------
> >  drivers/i2c/busses/i2c-mlxbf.c         | 19 +++++---------
> >  drivers/perf/qcom_l2_pmu.c             |  7 +++---
> >  drivers/spi/spi-pxa2xx.c               | 34 +++++++-------------------
> >  include/acpi/acpi_bus.h                |  1 +
> >  include/linux/acpi.h                   |  5 ++++
> >  10 files changed, 81 insertions(+), 75 deletions(-)
> > 
> 
> Thanks, patches 1-7 look good to me:
> 
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> 
> for patches 1-7.
> 
> I have one small remark for patch 8, which I will send in
> a reply to patch 8.

Thanks for review!