[PATCH 3/4] mmc: jz4740: Fix Wvoid-pointer-to-enum-cast warning

Paul Cercueil paul at crapouillou.net
Wed Dec 24 05:30:56 PST 2025


Hi Krzysztof,

Le mercredi 24 décembre 2025 à 13:44 +0100, Krzysztof Kozlowski a
écrit :
> "jz4740" is an enum, thus cast of pointer on 64-bit compile test with
> clang W=1 causes:
> 
>   jz4740_mmc.c:1055:18: error: cast to smaller integer type 'enum
> jz4740_mmc_version' from 'const void *' [-Werror,-Wvoid-pointer-to-
> enum-cast]
> 
> Signed-off-by: Krzysztof Kozlowski
> <krzysztof.kozlowski at oss.qualcomm.com>

Reviewed-by: Paul Cercueil <paul at crapouillou.net>

Cheers,
-Paul

> ---
>  drivers/mmc/host/jz4740_mmc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/jz4740_mmc.c
> b/drivers/mmc/host/jz4740_mmc.c
> index 6a0d0250d47b..6a3c26b7c82d 100644
> --- a/drivers/mmc/host/jz4740_mmc.c
> +++ b/drivers/mmc/host/jz4740_mmc.c
> @@ -1052,7 +1052,7 @@ static int jz4740_mmc_probe(struct
> platform_device* pdev)
>  	host = mmc_priv(mmc);
>  
>  	/* Default if no match is JZ4740 */
> -	host->version = (enum
> jz4740_mmc_version)device_get_match_data(&pdev->dev);
> +	host->version = (unsigned long)device_get_match_data(&pdev-
> >dev);
>  
>  	ret = mmc_of_parse(mmc);
>  	if (ret)



More information about the linux-arm-kernel mailing list