diff mbox series

[1/4] phy: broadcom: sata: fix Wvoid-pointer-to-enum-cast warning

Message ID 20230810111958.205705-1-krzysztof.kozlowski@linaro.org
State Accepted
Commit d35c12b7db15e2c1316c32bad24dea2255c5f7b3
Headers show
Series [1/4] phy: broadcom: sata: fix Wvoid-pointer-to-enum-cast warning | expand

Commit Message

Krzysztof Kozlowski Aug. 10, 2023, 11:19 a.m. UTC
'version' is an enum, thus cast of pointer on 64-bit compile test with
W=1 causes:

  phy-brcm-sata.c:775:19: error: cast to smaller integer type 'enum brcm_sata_phy_version' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/phy/broadcom/phy-brcm-sata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Vinod Koul Aug. 11, 2023, 8:30 a.m. UTC | #1
On Thu, 10 Aug 2023 13:19:55 +0200, Krzysztof Kozlowski wrote:
> 'version' is an enum, thus cast of pointer on 64-bit compile test with
> W=1 causes:
> 
>   phy-brcm-sata.c:775:19: error: cast to smaller integer type 'enum brcm_sata_phy_version' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]
> 
> 

Applied, thanks!

[1/4] phy: broadcom: sata: fix Wvoid-pointer-to-enum-cast warning
      commit: d35c12b7db15e2c1316c32bad24dea2255c5f7b3
[2/4] phy: broadcom: ns-usb3: fix Wvoid-pointer-to-enum-cast warning
      commit: bd6e74a2f0a0c76dda8e44d26f9b91a797586c3b
[3/4] phy: broadcom: sr-usb: fix Wvoid-pointer-to-enum-cast warning
      commit: 2bc00b9b9001329792b14ce20141f334b6debcbc
[4/4] phy: marvell pxa-usb: fix Wvoid-pointer-to-enum-cast warning
      commit: 7451eecf1ef8be9911749e927ce5690262cc9197

Best regards,
diff mbox series

Patch

diff --git a/drivers/phy/broadcom/phy-brcm-sata.c b/drivers/phy/broadcom/phy-brcm-sata.c
index 769c707d9b71..ed9e18791ec9 100644
--- a/drivers/phy/broadcom/phy-brcm-sata.c
+++ b/drivers/phy/broadcom/phy-brcm-sata.c
@@ -772,7 +772,7 @@  static int brcm_sata_phy_probe(struct platform_device *pdev)
 
 	of_id = of_match_node(brcm_sata_phy_of_match, dn);
 	if (of_id)
-		priv->version = (enum brcm_sata_phy_version)of_id->data;
+		priv->version = (uintptr_t)of_id->data;
 	else
 		priv->version = BRCM_SATA_PHY_STB_28NM;