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: bcm-iproc: Fix Wvoid-pointer-to-enum-cast warning

'type' is an enum, thus cast of pointer on 64-bit compile test with
clang and W=1 causes:

i2c-bcm-iproc.c:1102:3: error: cast to smaller integer type 'enum bcm_iproc_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>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20251126182257.157439-4-krzysztof.kozlowski@oss.qualcomm.com

authored by

Krzysztof Kozlowski and committed by
Andi Shyti
60d7f603 8f0b4cce

+1 -2
+1 -2
drivers/i2c/busses/i2c-bcm-iproc.c
··· 1098 1098 1099 1099 platform_set_drvdata(pdev, iproc_i2c); 1100 1100 iproc_i2c->device = &pdev->dev; 1101 - iproc_i2c->type = 1102 - (enum bcm_iproc_i2c_type)of_device_get_match_data(&pdev->dev); 1101 + iproc_i2c->type = (kernel_ulong_t)of_device_get_match_data(&pdev->dev); 1103 1102 init_completion(&iproc_i2c->done); 1104 1103 1105 1104 iproc_i2c->base = devm_platform_ioremap_resource(pdev, 0);