]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
i2c: rcar: Fix Wvoid-pointer-to-enum-cast warning
authorKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Wed, 26 Nov 2025 18:23:00 +0000 (19:23 +0100)
committerAndi Shyti <andi.shyti@kernel.org>
Tue, 16 Dec 2025 23:28:50 +0000 (00:28 +0100)
'i2c_types' is an enum, thus cast of pointer on 64-bit compile test with
clang and W=1 causes:

  i2c-rcar.c:1144:18: error: cast to smaller integer type 'enum rcar_i2c_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

One of the discussions in 2023 on LKML suggested warning is not suitable
for kernel.  Nothing changed in this regard since that time, so assume
the warning will stay and we want to have warnings-free builds.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20251126182257.157439-6-krzysztof.kozlowski@oss.qualcomm.com
drivers/i2c/busses/i2c-rcar.c

index d51884ab99f4ddb3a6db0b3bbeb2f565ccd2711f..5ce8f8e4856fb2bb21c9cd731ddbbd8f3622ca26 100644 (file)
@@ -1141,7 +1141,7 @@ static int rcar_i2c_probe(struct platform_device *pdev)
        if (IS_ERR(priv->io))
                return PTR_ERR(priv->io);
 
-       priv->devtype = (enum rcar_i2c_type)of_device_get_match_data(dev);
+       priv->devtype = (kernel_ulong_t)of_device_get_match_data(dev);
        init_waitqueue_head(&priv->wait);
 
        adap = &priv->adap;