OSDN Git Service

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

index a1a80f1..6749131 100644 (file)
@@ -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) {