Skip to content

Commit fb21116

Browse files
krzkvinodkoul
authored andcommitted
phy: broadcom: ns-usb3: Fix Wvoid-pointer-to-enum-cast warning (again)
"family" is an enum, thus cast of pointer on 64-bit compile test with clang W=1 causes: phy-bcm-ns-usb3.c:206:17: error: cast to smaller integer type 'enum bcm_ns_family' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] This was already fixed in commit bd6e74a ("phy: broadcom: ns-usb3: fix Wvoid-pointer-to-enum-cast warning") but then got bad in commit 21bf6fc ("phy: Use device_get_match_data()"). Note that after various discussions the preferred cast is via "unsigned long", not "uintptr_t". Fixes: 21bf6fc ("phy: Use device_get_match_data()") Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Link: https://patch.msgid.link/20251224115533.154162-2-krzysztof.kozlowski@oss.qualcomm.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent b246caa commit fb21116

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/phy/broadcom/phy-bcm-ns-usb3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ static int bcm_ns_usb3_mdio_probe(struct mdio_device *mdiodev)
203203
usb3->dev = dev;
204204
usb3->mdiodev = mdiodev;
205205

206-
usb3->family = (enum bcm_ns_family)device_get_match_data(dev);
206+
usb3->family = (unsigned long)device_get_match_data(dev);
207207

208208
syscon_np = of_parse_phandle(dev->of_node, "usb3-dmp-syscon", 0);
209209
err = of_address_to_resource(syscon_np, 0, &res);

0 commit comments

Comments
 (0)