All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ACPI: dock: fix enum-conversion warning
@ 2020-10-26 21:48 Arnd Bergmann
  2020-10-27  1:10 ` Hanjun Guo
  2020-10-27 18:31 ` Rafael J. Wysocki
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2020-10-26 21:48 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Yinghai Lu
  Cc: Arnd Bergmann, Gustavo A. R. Silva, Hanjun Guo, linux-acpi, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

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")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/acpi/dock.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
index 45d4b7b69de8..24e076f44d23 100644
--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -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);
-- 
2.27.0


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

* Re: [PATCH] ACPI: dock: fix enum-conversion warning
  2020-10-26 21:48 [PATCH] ACPI: dock: fix enum-conversion warning Arnd Bergmann
@ 2020-10-27  1:10 ` Hanjun Guo
  2020-10-27 18:31 ` Rafael J. Wysocki
  1 sibling, 0 replies; 3+ messages in thread
From: Hanjun Guo @ 2020-10-27  1:10 UTC (permalink / raw)
  To: Arnd Bergmann, Rafael J. Wysocki, Len Brown, Yinghai Lu
  Cc: Arnd Bergmann, Gustavo A. R. Silva, linux-acpi, linux-kernel

On 2020/10/27 5:48, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> 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")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>   drivers/acpi/dock.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
> index 45d4b7b69de8..24e076f44d23 100644
> --- a/drivers/acpi/dock.c
> +++ b/drivers/acpi/dock.c
> @@ -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);

Reviewed-by: Hanjun Guo <guohanjun@huawei.com>

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

* Re: [PATCH] ACPI: dock: fix enum-conversion warning
  2020-10-26 21:48 [PATCH] ACPI: dock: fix enum-conversion warning Arnd Bergmann
  2020-10-27  1:10 ` Hanjun Guo
@ 2020-10-27 18:31 ` Rafael J. Wysocki
  1 sibling, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2020-10-27 18:31 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Rafael J. Wysocki, Len Brown, Yinghai Lu, Arnd Bergmann,
	Gustavo A. R. Silva, Hanjun Guo, ACPI Devel Maling List,
	Linux Kernel Mailing List

On Mon, Oct 26, 2020 at 10:48 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> 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")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/acpi/dock.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
> index 45d4b7b69de8..24e076f44d23 100644
> --- a/drivers/acpi/dock.c
> +++ b/drivers/acpi/dock.c
> @@ -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!

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

end of thread, other threads:[~2020-10-27 18:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-26 21:48 [PATCH] ACPI: dock: fix enum-conversion warning Arnd Bergmann
2020-10-27  1:10 ` Hanjun Guo
2020-10-27 18:31 ` 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.