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: pxa: 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-pxa.c:1269:15: error: cast to smaller integer type 'enum pxa_i2c_types' 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>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20251126182257.157439-5-krzysztof.kozlowski@oss.qualcomm.com

authored by

Krzysztof Kozlowski and committed by
Andi Shyti
3ff79e76 60d7f603

+1 -1
+1 -1
drivers/i2c/busses/i2c-pxa.c
··· 1266 1266 i2c->use_pio = of_property_read_bool(np, "mrvl,i2c-polling"); 1267 1267 i2c->fast_mode = of_property_read_bool(np, "mrvl,i2c-fast-mode"); 1268 1268 1269 - *i2c_types = (enum pxa_i2c_types)device_get_match_data(&pdev->dev); 1269 + *i2c_types = (kernel_ulong_t)device_get_match_data(&pdev->dev); 1270 1270 1271 1271 return 0; 1272 1272 }