Skip to contentSkip to conversation

ACPI: bus: Drop kernel doc annotation from acpi_bus_notify()

PATCH In review Andy Shevchenko 2 participants 3 messages Aug 26, 2022 – Sep 3, 2022 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 ACPI: bus: Drop kernel doc annotation from acpi_bus_notify()

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.

---
v2: no changes

 drivers/acpi/bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/bus.c +1 -1
index f60d4dc45c1f..f3e868d35144 100644
@@ -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).
Signature · 1 line
2.35.1
#1 lore raw

PATCH v2 2/2 ACPI: bus: Refactor ACPI matching functions for better readability

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

---
v2: refactored another function (due to drop the rest of the series)

 drivers/acpi/bus.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/acpi/bus.c +10 -10
index f3e868d35144..d466c8195314 100644
@@ -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);
 
Signature · 1 line
2.35.1
#2 lore raw

Re: [PATCH v2 2/2] ACPI: bus: Refactor ACPI matching functions for better readability

Quoted 43 lines · Andy Shevchenko

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

---
v2: refactored another function (due to drop the rest of the series)

 drivers/acpi/bus.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/acpi/bus.c +4 -10
index f3e868d35144..d466c8195314 100644
@@ -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;

drivers/acpi/bus.c EXPORT_SYMBOL(acpi_match_device_ids);

Quoted 10 lines
drivers/acpi/bus.c +6 -1
+       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!