net/xgene: fix Wvoid-pointer-to-enum-cast warning
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Thu, 10 Aug 2023 10:39:22 +0000 (12:39 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 11 Aug 2023 08:58:45 +0000 (09:58 +0100)
'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
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/apm/xgene/xgene_enet_main.c

index 41d96f4..4d4140b 100644 (file)
@@ -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 {