OSDN Git Service

phy: broadcom: ns-usb3: fix Wvoid-pointer-to-enum-cast warning
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Thu, 10 Aug 2023 11:19:56 +0000 (13:19 +0200)
committerVinod Koul <vkoul@kernel.org>
Fri, 11 Aug 2023 08:25:14 +0000 (09:25 +0100)
'family' is an enum, thus cast of pointer on 64-bit compile test with
W=1 causes:

  drivers/phy/broadcom/phy-bcm-ns-usb3.c:209:17: error: cast to smaller integer type 'enum bcm_ns_family' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230810111958.205705-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/broadcom/phy-bcm-ns-usb3.c

index bbfad20..69584b6 100644 (file)
@@ -206,7 +206,7 @@ static int bcm_ns_usb3_mdio_probe(struct mdio_device *mdiodev)
        of_id = of_match_device(bcm_ns_usb3_id_table, dev);
        if (!of_id)
                return -EINVAL;
-       usb3->family = (enum bcm_ns_family)of_id->data;
+       usb3->family = (uintptr_t)of_id->data;
 
        syscon_np = of_parse_phandle(dev->of_node, "usb3-dmp-syscon", 0);
        err = of_address_to_resource(syscon_np, 0, &res);