Skip to contentSkip to conversation

rtc: mxc: Silence a clang warning

PATCH Applied Fabio Estevam 2 participants 2 messages May 26, 2022 – Jun 1, 2022

Subsystems (2)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/1 rtc: mxc: Silence a clang warning

Change the of_device_get_match_data() cast to (uintptr_t) to silence the following clang warning:

drivers/rtc/rtc-mxc.c:315:19: warning: cast to smaller integer type 'enum imx_rtc_type' from 'const void *' [-Wvoid-pointer-to-enum-cast]

Fixes ba7aa63000f2 ("rtc: mxc: use of_device_get_match_data")
---
 drivers/rtc/rtc-mxc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-mxc.c +1 -1
index 0f08f22df869..53d4e253e81f 100644
@@ -311,7 +311,7 @@ static int mxc_rtc_probe(struct platform_device *pdev)
 	if (!pdata)
 		return -ENOMEM;
 
-	pdata->devtype = (enum imx_rtc_type)of_device_get_match_data(&pdev->dev);
+	pdata->devtype = (uintptr_t)of_device_get_match_data(&pdev->dev);
 
 	pdata->ioaddr = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(pdata->ioaddr))
Signature · 1 line
2.25.1
maintainer Applied
#1 lore raw
Quoted 6 lines · Fabio Estevam

Change the of_device_get_match_data() cast to (uintptr_t) to silence the following clang warning:

drivers/rtc/rtc-mxc.c:315:19: warning: cast to smaller integer type 'enum imx_rtc_type' from 'const void *' [-Wvoid-pointer-to-enum-cast]

Applied, thanks!

[1/1] rtc: mxc: Silence a clang warning

      commit: f78e3d407a339ffdd2620140300f821ea41118f4

Best regards,

Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com