diff mbox series

[net-next,1/2] net/xgene: fix Wvoid-pointer-to-enum-cast warning

Message ID 20230810103923.151226-1-krzysztof.kozlowski@linaro.org (mailing list archive)
State Accepted
Commit c5b0c34fae1ef234982d55445b8aa482f0b05ba6
Delegated to: Netdev Maintainers
Headers show
Series [net-next,1/2] net/xgene: fix Wvoid-pointer-to-enum-cast warning | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1330 this patch: 1330
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang fail Errors and warnings before: 1365 this patch: 1363
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1353 this patch: 1353
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Krzysztof Kozlowski Aug. 10, 2023, 10:39 a.m. UTC
'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(-)

Comments

Simon Horman Aug. 10, 2023, 8:24 p.m. UTC | #1
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
patchwork-bot+netdevbpf@kernel.org Aug. 11, 2023, 9 a.m. UTC | #2
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!
diff mbox series

Patch

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 {