public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 1/2] net/xgene: fix Wvoid-pointer-to-enum-cast warning
@ 2023-08-10 10:39 Krzysztof Kozlowski
  2023-08-10 10:39 ` [PATCH net-next 2/2] net/marvell: " Krzysztof Kozlowski
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-10 10:39 UTC (permalink / raw)
  To: Iyappan Subramanian, Keyur Chudgar, Quan Nguyen, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, netdev, linux-kernel
  Cc: Andi Shyti, Krzysztof Kozlowski

'enet_id' is an enum, thus cast of pointer on 64-bit compile test with
W=1 causes:

  xgene_enet_main.c:2044:20: error: cast to smaller integer type 'enum xgene_enet_id' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
index 41d96f4b23d8..4d4140b7c450 100644
--- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
+++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
@@ -2041,7 +2041,7 @@ static int xgene_enet_probe(struct platform_device *pdev)
 
 	of_id = of_match_device(xgene_enet_of_match, &pdev->dev);
 	if (of_id) {
-		pdata->enet_id = (enum xgene_enet_id)of_id->data;
+		pdata->enet_id = (uintptr_t)of_id->data;
 	}
 #ifdef CONFIG_ACPI
 	else {
-- 
2.34.1


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

* [PATCH net-next 2/2] net/marvell: fix Wvoid-pointer-to-enum-cast warning
  2023-08-10 10:39 [PATCH net-next 1/2] net/xgene: fix Wvoid-pointer-to-enum-cast warning Krzysztof Kozlowski
@ 2023-08-10 10:39 ` Krzysztof Kozlowski
  2023-08-10 20:24   ` Simon Horman
  2023-08-10 20:24 ` [PATCH net-next 1/2] net/xgene: " Simon Horman
  2023-08-11  9:00 ` patchwork-bot+netdevbpf
  2 siblings, 1 reply; 5+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-10 10:39 UTC (permalink / raw)
  To: Iyappan Subramanian, Keyur Chudgar, Quan Nguyen, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, netdev, linux-kernel
  Cc: Andi Shyti, Krzysztof Kozlowski

'type' is an enum, thus cast of pointer on 64-bit compile test with
W=1 causes:

  mvmdio.c:272:9: error: cast to smaller integer type 'enum orion_mdio_bus_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/net/ethernet/marvell/mvmdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/mvmdio.c b/drivers/net/ethernet/marvell/mvmdio.c
index a1a80f13b1e8..674913184ebf 100644
--- a/drivers/net/ethernet/marvell/mvmdio.c
+++ b/drivers/net/ethernet/marvell/mvmdio.c
@@ -269,7 +269,7 @@ static int orion_mdio_probe(struct platform_device *pdev)
 	struct orion_mdio_dev *dev;
 	int i, ret;
 
-	type = (enum orion_mdio_bus_type)device_get_match_data(&pdev->dev);
+	type = (uintptr_t)device_get_match_data(&pdev->dev);
 
 	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!r) {
-- 
2.34.1


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

* Re: [PATCH net-next 2/2] net/marvell: fix Wvoid-pointer-to-enum-cast warning
  2023-08-10 10:39 ` [PATCH net-next 2/2] net/marvell: " Krzysztof Kozlowski
@ 2023-08-10 20:24   ` Simon Horman
  0 siblings, 0 replies; 5+ messages in thread
From: Simon Horman @ 2023-08-10 20:24 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Iyappan Subramanian, Keyur Chudgar, Quan Nguyen, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, netdev, linux-kernel,
	Andi Shyti

On Thu, Aug 10, 2023 at 12:39:23PM +0200, Krzysztof Kozlowski wrote:
> 'type' is an enum, thus cast of pointer on 64-bit compile test with
> W=1 causes:
> 
>   mvmdio.c:272:9: error: cast to smaller integer type 'enum orion_mdio_bus_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Simon Horman <horms@kernel.org> # build-tested

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

* Re: [PATCH net-next 1/2] net/xgene: fix Wvoid-pointer-to-enum-cast warning
  2023-08-10 10:39 [PATCH net-next 1/2] net/xgene: fix Wvoid-pointer-to-enum-cast warning Krzysztof Kozlowski
  2023-08-10 10:39 ` [PATCH net-next 2/2] net/marvell: " Krzysztof Kozlowski
@ 2023-08-10 20:24 ` Simon Horman
  2023-08-11  9:00 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 5+ messages in thread
From: Simon Horman @ 2023-08-10 20:24 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Iyappan Subramanian, Keyur Chudgar, Quan Nguyen, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, netdev, linux-kernel,
	Andi Shyti

On Thu, Aug 10, 2023 at 12:39:22PM +0200, Krzysztof Kozlowski wrote:
> 'enet_id' is an enum, thus cast of pointer on 64-bit compile test with
> W=1 causes:
> 
>   xgene_enet_main.c:2044:20: error: cast to smaller integer type 'enum xgene_enet_id' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Simon Horman <horms@kernel.org> # build-tested

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

* Re: [PATCH net-next 1/2] net/xgene: fix Wvoid-pointer-to-enum-cast warning
  2023-08-10 10:39 [PATCH net-next 1/2] net/xgene: fix Wvoid-pointer-to-enum-cast warning Krzysztof Kozlowski
  2023-08-10 10:39 ` [PATCH net-next 2/2] net/marvell: " Krzysztof Kozlowski
  2023-08-10 20:24 ` [PATCH net-next 1/2] net/xgene: " Simon Horman
@ 2023-08-11  9:00 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-08-11  9:00 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: iyappan, keyur, quan, davem, edumazet, kuba, pabeni, netdev,
	linux-kernel, andi.shyti

Hello:

This series was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Thu, 10 Aug 2023 12:39:22 +0200 you wrote:
> 'enet_id' is an enum, thus cast of pointer on 64-bit compile test with
> W=1 causes:
> 
>   xgene_enet_main.c:2044:20: error: cast to smaller integer type 'enum xgene_enet_id' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
> [...]

Here is the summary with links:
  - [net-next,1/2] net/xgene: fix Wvoid-pointer-to-enum-cast warning
    https://git.kernel.org/netdev/net-next/c/c5b0c34fae1e
  - [net-next,2/2] net/marvell: fix Wvoid-pointer-to-enum-cast warning
    https://git.kernel.org/netdev/net-next/c/e5cd429e7928

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2023-08-11  9:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-10 10:39 [PATCH net-next 1/2] net/xgene: fix Wvoid-pointer-to-enum-cast warning Krzysztof Kozlowski
2023-08-10 10:39 ` [PATCH net-next 2/2] net/marvell: " Krzysztof Kozlowski
2023-08-10 20:24   ` Simon Horman
2023-08-10 20:24 ` [PATCH net-next 1/2] net/xgene: " Simon Horman
2023-08-11  9:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox