Skip to contentSkip to conversation

mmc: 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 mmc: mxc: Silence a clang warning

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

drivers/mmc/host/mxcmmc.c:1028:18: warning: cast to smaller integer type 'enum mxcmci_type' from 'const void *' [-Wvoid-pointer-to-enum-cast]

Fixes 8223e885e74b ("mmc: mxc: Convert the driver to DT-only")
---
 drivers/mmc/host/mxcmmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/mxcmmc.c +1 -1
index de04b5afef2e..613f13306433 100644
@@ -1025,7 +1025,7 @@ static int mxcmci_probe(struct platform_device *pdev)
 	mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;
 	mmc->max_seg_size = mmc->max_req_size;
 
-	host->devtype = (enum mxcmci_type)of_device_get_match_data(&pdev->dev);
+	host->devtype = (uintptr_t)of_device_get_match_data(&pdev->dev);
 
 	/* adjust max_segs after devtype detection */
 	if (!is_mpc512x_mmc(host))
Signature · 1 line
2.25.1
Applied
#1 lore raw
Quoted 9 lines · Fabio Estevam

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

drivers/mmc/host/mxcmmc.c:1028:18: warning: cast to smaller integer type 'enum mxcmci_type' from 'const void *' [-Wvoid-pointer-to-enum-cast]

Fixes 8223e885e74b ("mmc: mxc: Convert the driver to DT-only")

Queued for v5.20 on the devel branch, thanks!

Kind regards
Uffe

Quoted 20 lines
---
 drivers/mmc/host/mxcmmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/mxcmmc.c +1 -2
index de04b5afef2e..613f13306433 100644
@@ -1025,7 +1025,7 @@ static int mxcmci_probe(struct platform_device *pdev)
        mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;
        mmc->max_seg_size = mmc->max_req_size;
 
-       host->devtype = (enum mxcmci_type)of_device_get_match_data(&pdev->dev);
+       host->devtype = (uintptr_t)of_device_get_match_data(&pdev->dev);
 
        /* adjust max_segs after devtype detection */
        if (!is_mpc512x_mmc(host))
--

2.25.1