2021-07-12 17:31:22

by Rafael J. Wysocki

[permalink] [raw]
Subject: [PATCH v1 0/6] ACPI: glue / driver core: Eliminate acpi_platform_notify() and split device_platform_notify()

Hi Greg et al,

This series doesn't change functionality (at least not intentionally), but
it get rids of a few unneeded checks, parameter passing etc.

Patches [1-2/6] simplify the ACPI "glue" code.

Patch [3/6] renames a couple of ACPI functions to avoid name collisions going
forward.

Patch [4/6] gets rid of acpi_platform_notify().

Patch [5/6] rearranges the software nodes code along the lines of what happens
to the ACPI "glue" code in patch [4/6].

Patch [6/6] deals with device_platform_notify().

Please review and let me know if there are any concerns regarding this.

Thanks!




2021-07-12 17:32:24

by Rafael J. Wysocki

[permalink] [raw]
Subject: [PATCH v1 3/6] ACPI: bus: Rename functions to avoid name collision

From: Rafael J. Wysocki <[email protected]>

There is a name collision between acpi_device_notify() defined in
bus.c and another static function defined in glue.c.

Since the latter is going to be exported from that file, rename the
former to acpi_notify_device() and rename acpi_device_notify_fixed()
to follow the same naming pattern.

No functional impact.

Signed-off-by: Rafael J. Wysocki <[email protected]>
---
drivers/acpi/bus.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

Index: linux-pm/drivers/acpi/bus.c
===================================================================
--- linux-pm.orig/drivers/acpi/bus.c
+++ linux-pm/drivers/acpi/bus.c
@@ -498,24 +498,24 @@ static void acpi_bus_notify(acpi_handle
acpi_evaluate_ost(handle, type, ost_code, NULL);
}

-static void acpi_device_notify(acpi_handle handle, u32 event, void *data)
+static void acpi_notify_device(acpi_handle handle, u32 event, void *data)
{
struct acpi_device *device = data;

device->driver->ops.notify(device, event);
}

-static void acpi_device_notify_fixed(void *data)
+static void acpi_notify_device_fixed(void *data)
{
struct acpi_device *device = data;

/* Fixed hardware devices have no handles */
- acpi_device_notify(NULL, ACPI_FIXED_HARDWARE_EVENT, device);
+ acpi_notify_device(NULL, ACPI_FIXED_HARDWARE_EVENT, device);
}

static u32 acpi_device_fixed_event(void *data)
{
- acpi_os_execute(OSL_NOTIFY_HANDLER, acpi_device_notify_fixed, data);
+ acpi_os_execute(OSL_NOTIFY_HANDLER, acpi_notify_device_fixed, data);
return ACPI_INTERRUPT_HANDLED;
}

@@ -536,7 +536,7 @@ static int acpi_device_install_notify_ha
else
status = acpi_install_notify_handler(device->handle,
ACPI_DEVICE_NOTIFY,
- acpi_device_notify,
+ acpi_notify_device,
device);

if (ACPI_FAILURE(status))
@@ -554,7 +554,7 @@ static void acpi_device_remove_notify_ha
acpi_device_fixed_event);
else
acpi_remove_notify_handler(device->handle, ACPI_DEVICE_NOTIFY,
- acpi_device_notify);
+ acpi_notify_device);
}

/* Handle events targeting \_SB device (at present only graceful shutdown) */



2021-07-12 18:06:00

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v1 0/6] ACPI: glue / driver core: Eliminate acpi_platform_notify() and split device_platform_notify()

On Mon, Jul 12, 2021 at 07:19:57PM +0200, Rafael J. Wysocki wrote:
> Hi Greg et al,
>
> This series doesn't change functionality (at least not intentionally), but
> it get rids of a few unneeded checks, parameter passing etc.
>
> Patches [1-2/6] simplify the ACPI "glue" code.
>
> Patch [3/6] renames a couple of ACPI functions to avoid name collisions going
> forward.
>
> Patch [4/6] gets rid of acpi_platform_notify().
>
> Patch [5/6] rearranges the software nodes code along the lines of what happens
> to the ACPI "glue" code in patch [4/6].
>
> Patch [6/6] deals with device_platform_notify().
>
> Please review and let me know if there are any concerns regarding this.

Looks good, I only had one small naming comment on patch 5/6.

thanks,

greg k-h

2021-07-12 18:43:45

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v1 0/6] ACPI: glue / driver core: Eliminate acpi_platform_notify() and split device_platform_notify()

On Mon, Jul 12, 2021 at 07:19:57PM +0200, Rafael J. Wysocki wrote:
> Hi Greg et al,
>
> This series doesn't change functionality (at least not intentionally), but
> it get rids of a few unneeded checks, parameter passing etc.
>
> Patches [1-2/6] simplify the ACPI "glue" code.
>
> Patch [3/6] renames a couple of ACPI functions to avoid name collisions going
> forward.
>
> Patch [4/6] gets rid of acpi_platform_notify().
>
> Patch [5/6] rearranges the software nodes code along the lines of what happens
> to the ACPI "glue" code in patch [4/6].
>
> Patch [6/6] deals with device_platform_notify().
>
> Please review and let me know if there are any concerns regarding this.

The result looks good to me, but perhaps the ordering can be changed to
minimize addition of the lines that are going to be removed inside the same
series.

In either case, feel free to add
Reviewed-by: Andy Shevchenko <[email protected]>

--
With Best Regards,
Andy Shevchenko


2021-07-14 18:19:17

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: [PATCH v1 0/6] ACPI: glue / driver core: Eliminate acpi_platform_notify() and split device_platform_notify()

On Mon, Jul 12, 2021 at 8:39 PM Andy Shevchenko
<[email protected]> wrote:
>
> On Mon, Jul 12, 2021 at 07:19:57PM +0200, Rafael J. Wysocki wrote:
> > Hi Greg et al,
> >
> > This series doesn't change functionality (at least not intentionally), but
> > it get rids of a few unneeded checks, parameter passing etc.
> >
> > Patches [1-2/6] simplify the ACPI "glue" code.
> >
> > Patch [3/6] renames a couple of ACPI functions to avoid name collisions going
> > forward.
> >
> > Patch [4/6] gets rid of acpi_platform_notify().
> >
> > Patch [5/6] rearranges the software nodes code along the lines of what happens
> > to the ACPI "glue" code in patch [4/6].
> >
> > Patch [6/6] deals with device_platform_notify().
> >
> > Please review and let me know if there are any concerns regarding this.
>
> The result looks good to me, but perhaps the ordering can be changed to
> minimize addition of the lines that are going to be removed inside the same
> series.
>
> In either case, feel free to add
> Reviewed-by: Andy Shevchenko <[email protected]>

Thanks!