]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mmc: jz4740: Fix Wvoid-pointer-to-enum-cast warning
authorKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Wed, 24 Dec 2025 12:44:34 +0000 (13:44 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 23 Feb 2026 11:06:53 +0000 (12:06 +0100)
"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@oss.qualcomm.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/jz4740_mmc.c

index 6a0d0250d47b6ac855a6cab58a0eebb30802194a..6a3c26b7c82d803aeccaecd557f7770b43abf5b7 100644 (file)
@@ -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)