Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

i2c: rcar: Fix Wvoid-pointer-to-enum-cast warning

'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

authored by

Krzysztof Kozlowski and committed by
Andi Shyti
4c544cd6 3ff79e76

+1 -1
+1 -1
drivers/i2c/busses/i2c-rcar.c
··· 1141 1141 if (IS_ERR(priv->io)) 1142 1142 return PTR_ERR(priv->io); 1143 1143 1144 - priv->devtype = (enum rcar_i2c_type)of_device_get_match_data(dev); 1144 + priv->devtype = (kernel_ulong_t)of_device_get_match_data(dev); 1145 1145 init_waitqueue_head(&priv->wait); 1146 1146 1147 1147 adap = &priv->adap;