]> git.ipfire.org Git - thirdparty/linux.git/commit
phy: broadcom: ns-usb3: Fix Wvoid-pointer-to-enum-cast warning (again)
authorKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Wed, 24 Dec 2025 11:55:34 +0000 (12:55 +0100)
committerVinod Koul <vkoul@kernel.org>
Thu, 1 Jan 2026 10:59:51 +0000 (16:29 +0530)
commitfb21116099bbea1fc59efa9207e63c4be390ab72
tree28bda322b2710764f3fa0230f66c6426203f0bcd
parentb246caa68037aa495390a60d080acaeb84f45fff
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 bd6e74a2f0a0 ("phy: broadcom: ns-usb3:
fix Wvoid-pointer-to-enum-cast warning") but then got bad in commit
21bf6fc47a1e ("phy: Use device_get_match_data()").

Note that after various discussions the preferred cast is via "unsigned
long", not "uintptr_t".

Fixes: 21bf6fc47a1e ("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>
drivers/phy/broadcom/phy-bcm-ns-usb3.c