All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] ACPI: bus: Drop kernel doc annotation from acpi_bus_notify()
@ 2022-08-26 17:16 Andy Shevchenko
  2022-08-26 17:16 ` [PATCH v2 2/2] ACPI: bus: Refactor ACPI matching functions for better readability Andy Shevchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2022-08-26 17:16 UTC (permalink / raw)
  To: Rafael J. Wysocki, linux-acpi, linux-kernel
  Cc: Rafael J. Wysocki, Len Brown, Andy Shevchenko

The description for acpi_bus_notify() is quite far from what
kernel doc expects. It complains about this:

  Function parameter or member 'handle' not described in 'acpi_bus_notify'
  Function parameter or member 'type' not described in 'acpi_bus_notify'
  Function parameter or member 'data' not described in 'acpi_bus_notify'

Fix this by dropping kernel doc annotation.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v2: no changes
 drivers/acpi/bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index f60d4dc45c1f..f3e868d35144 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -456,7 +456,7 @@ static void acpi_bus_osc_negotiate_usb_control(void)
                              Notification Handling
    -------------------------------------------------------------------------- */
 
-/**
+/*
  * acpi_bus_notify
  * ---------------
  * Callback for all 'system-level' device notifications (values 0x00-0x7F).
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v2 2/2] ACPI: bus: Refactor ACPI matching functions for better readability
  2022-08-26 17:16 [PATCH v2 1/2] ACPI: bus: Drop kernel doc annotation from acpi_bus_notify() Andy Shevchenko
@ 2022-08-26 17:16 ` Andy Shevchenko
  2022-09-03 18:42   ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2022-08-26 17:16 UTC (permalink / raw)
  To: Rafael J. Wysocki, linux-acpi, linux-kernel
  Cc: Rafael J. Wysocki, Len Brown, Andy Shevchenko

With temporary variables for OF and ACPI IDs, it's easier to read
the code. No functional change intended.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v2: refactored another function (due to drop the rest of the series)
 drivers/acpi/bus.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index f3e868d35144..d466c8195314 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -925,12 +925,13 @@ static const void *acpi_of_device_get_match_data(const struct device *dev)
 
 const void *acpi_device_get_match_data(const struct device *dev)
 {
+	const struct acpi_device_id *acpi_ids = dev->driver->acpi_match_table;
 	const struct acpi_device_id *match;
 
-	if (!dev->driver->acpi_match_table)
+	if (!acpi_ids)
 		return acpi_of_device_get_match_data(dev);
 
-	match = acpi_match_device(dev->driver->acpi_match_table, dev);
+	match = acpi_match_device(acpi_ids, dev);
 	if (!match)
 		return NULL;
 
@@ -948,14 +949,13 @@ EXPORT_SYMBOL(acpi_match_device_ids);
 bool acpi_driver_match_device(struct device *dev,
 			      const struct device_driver *drv)
 {
-	if (!drv->acpi_match_table)
-		return acpi_of_match_device(ACPI_COMPANION(dev),
-					    drv->of_match_table,
-					    NULL);
-
-	return __acpi_match_device(acpi_companion_match(dev),
-				   drv->acpi_match_table, drv->of_match_table,
-				   NULL, NULL);
+	const struct acpi_device_id *acpi_ids = drv->acpi_match_table;
+	const struct of_device_id *of_ids = drv->of_match_table;
+
+	if (!acpi_ids)
+		return acpi_of_match_device(ACPI_COMPANION(dev), of_ids, NULL);
+
+	return __acpi_match_device(acpi_companion_match(dev), acpi_ids, of_ids, NULL, NULL);
 }
 EXPORT_SYMBOL_GPL(acpi_driver_match_device);
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 2/2] ACPI: bus: Refactor ACPI matching functions for better readability
  2022-08-26 17:16 ` [PATCH v2 2/2] ACPI: bus: Refactor ACPI matching functions for better readability Andy Shevchenko
@ 2022-09-03 18:42   ` Rafael J. Wysocki
  0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2022-09-03 18:42 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Rafael J. Wysocki, ACPI Devel Maling List,
	Linux Kernel Mailing List, Rafael J. Wysocki, Len Brown

On Fri, Aug 26, 2022 at 7:16 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> With temporary variables for OF and ACPI IDs, it's easier to read
> the code. No functional change intended.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> v2: refactored another function (due to drop the rest of the series)
>  drivers/acpi/bus.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
> index f3e868d35144..d466c8195314 100644
> --- a/drivers/acpi/bus.c
> +++ b/drivers/acpi/bus.c
> @@ -925,12 +925,13 @@ static const void *acpi_of_device_get_match_data(const struct device *dev)
>
>  const void *acpi_device_get_match_data(const struct device *dev)
>  {
> +       const struct acpi_device_id *acpi_ids = dev->driver->acpi_match_table;
>         const struct acpi_device_id *match;
>
> -       if (!dev->driver->acpi_match_table)
> +       if (!acpi_ids)
>                 return acpi_of_device_get_match_data(dev);
>
> -       match = acpi_match_device(dev->driver->acpi_match_table, dev);
> +       match = acpi_match_device(acpi_ids, dev);
>         if (!match)
>                 return NULL;
>
> @@ -948,14 +949,13 @@ EXPORT_SYMBOL(acpi_match_device_ids);
>  bool acpi_driver_match_device(struct device *dev,
>                               const struct device_driver *drv)
>  {
> -       if (!drv->acpi_match_table)
> -               return acpi_of_match_device(ACPI_COMPANION(dev),
> -                                           drv->of_match_table,
> -                                           NULL);
> -
> -       return __acpi_match_device(acpi_companion_match(dev),
> -                                  drv->acpi_match_table, drv->of_match_table,
> -                                  NULL, NULL);
> +       const struct acpi_device_id *acpi_ids = drv->acpi_match_table;
> +       const struct of_device_id *of_ids = drv->of_match_table;
> +
> +       if (!acpi_ids)
> +               return acpi_of_match_device(ACPI_COMPANION(dev), of_ids, NULL);
> +
> +       return __acpi_match_device(acpi_companion_match(dev), acpi_ids, of_ids, NULL, NULL);
>  }
>  EXPORT_SYMBOL_GPL(acpi_driver_match_device);
>
> --

Applied along with the [1/2] as 6.1 material, thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-03 18:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-26 17:16 [PATCH v2 1/2] ACPI: bus: Drop kernel doc annotation from acpi_bus_notify() Andy Shevchenko
2022-08-26 17:16 ` [PATCH v2 2/2] ACPI: bus: Refactor ACPI matching functions for better readability Andy Shevchenko
2022-09-03 18:42   ` Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.