Skip to contentSkip to conversation

ACPI: dock: fix enum-conversion warning

PATCH Applied Arnd Bergmann 3 participants 3 messages Oct 26, 2020 – Oct 27, 2020 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI: dock: fix enum-conversion warning

From: Arnd Bergmann <[email protected]>

gcc points out a type mismatch:

drivers/acpi/dock.c: In function 'hot_remove_dock_devices':
drivers/acpi/dock.c:234:53: warning: implicit conversion from 'enum <anonymous>' to 'enum dock_callback_type' [-Wenum-conversion]
234 | dock_hotplug_event(dd, ACPI_NOTIFY_EJECT_REQUEST, false);

This is harmless because 'false' still has the correct numeric value, but passing DOCK_CALL_HANDLER documents better what is going on and avoids the warning.

Fixes 37f908778f20 ("ACPI / dock: Walk list in reverse order during removal of devices")
Fixes f09ce741a03a ("ACPI / dock / PCI: Drop ACPI dock notifier chain")
---
 drivers/acpi/dock.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/acpi/dock.c +2 -1
index 45d4b7b69de8..24e076f44d23 100644
@@ -231,7 +231,8 @@ static void hot_remove_dock_devices(struct dock_station *ds)
 	 * between them).
 	 */
 	list_for_each_entry_reverse(dd, &ds->dependent_devices, list)
-		dock_hotplug_event(dd, ACPI_NOTIFY_EJECT_REQUEST, false);
+		dock_hotplug_event(dd, ACPI_NOTIFY_EJECT_REQUEST,
+				   DOCK_CALL_HANDLER);
 
 	list_for_each_entry_reverse(dd, &ds->dependent_devices, list)
 		acpi_bus_trim(dd->adev);
Signature · 1 line
2.27.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 24 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

gcc points out a type mismatch:

drivers/acpi/dock.c: In function 'hot_remove_dock_devices':
drivers/acpi/dock.c:234:53: warning: implicit conversion from 'enum <anonymous>' to 'enum dock_callback_type' [-Wenum-conversion]
234 | dock_hotplug_event(dd, ACPI_NOTIFY_EJECT_REQUEST, false);

This is harmless because 'false' still has the correct numeric value, but passing DOCK_CALL_HANDLER documents better what is going on and avoids the warning.

Fixes 37f908778f20 ("ACPI / dock: Walk list in reverse order during removal of devices")
Fixes f09ce741a03a ("ACPI / dock / PCI: Drop ACPI dock notifier chain")
---
  drivers/acpi/dock.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/acpi/dock.c +0 -0
index 45d4b7b69de8..24e076f44d23 100644

drivers/acpi/dock.c static void hot_remove_dock_devices(struct dock_station *ds) · line 238

Quoted 9 lines
drivers/acpi/dock.c +2 -1
@@ -231,7 +231,8 @@ static void hot_remove_dock_devices(struct dock_station *ds)
  	 * between them).
  	 */
  	list_for_each_entry_reverse(dd, &ds->dependent_devices, list)
-		dock_hotplug_event(dd, ACPI_NOTIFY_EJECT_REQUEST, false);
+		dock_hotplug_event(dd, ACPI_NOTIFY_EJECT_REQUEST,
+				   DOCK_CALL_HANDLER);
 
  	list_for_each_entry_reverse(dd, &ds->dependent_devices, list)
  		acpi_bus_trim(dd->adev);
maintainer Applied
#2 lore raw
In reply to Arnd Bergmann
Quoted 25 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

gcc points out a type mismatch:

drivers/acpi/dock.c: In function 'hot_remove_dock_devices':
drivers/acpi/dock.c:234:53: warning: implicit conversion from 'enum <anonymous>' to 'enum dock_callback_type' [-Wenum-conversion]
234 | dock_hotplug_event(dd, ACPI_NOTIFY_EJECT_REQUEST, false);

This is harmless because 'false' still has the correct numeric value, but passing DOCK_CALL_HANDLER documents better what is going on and avoids the warning.

Fixes 37f908778f20 ("ACPI / dock: Walk list in reverse order during removal of devices")
Fixes f09ce741a03a ("ACPI / dock / PCI: Drop ACPI dock notifier chain")
---
 drivers/acpi/dock.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/acpi/dock.c +0 -0
index 45d4b7b69de8..24e076f44d23 100644

drivers/acpi/dock.c static void hot_remove_dock_devices(struct dock_station *ds)

Quoted 10 lines
drivers/acpi/dock.c +2 -2
@@ -231,7 +231,8 @@ static void hot_remove_dock_devices(struct dock_station *ds)
         * between them).
         */
        list_for_each_entry_reverse(dd, &ds->dependent_devices, list)
-               dock_hotplug_event(dd, ACPI_NOTIFY_EJECT_REQUEST, false);
+               dock_hotplug_event(dd, ACPI_NOTIFY_EJECT_REQUEST,
+                                  DOCK_CALL_HANDLER);
 
        list_for_each_entry_reverse(dd, &ds->dependent_devices, list)
                acpi_bus_trim(dd->adev);
--

Applied as 5.10-rc material, thanks!