Unverified Commit 3ff79e76 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Andi Shyti
Browse files

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: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: default avatarAndi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20251126182257.157439-5-krzysztof.kozlowski@oss.qualcomm.com
parent 60d7f603
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1266,7 +1266,7 @@ static int i2c_pxa_probe_dt(struct platform_device *pdev, struct pxa_i2c *i2c,
	i2c->use_pio = of_property_read_bool(np, "mrvl,i2c-polling");
	i2c->fast_mode = of_property_read_bool(np, "mrvl,i2c-fast-mode");

	*i2c_types = (enum pxa_i2c_types)device_get_match_data(&pdev->dev);
	*i2c_types = (kernel_ulong_t)device_get_match_data(&pdev->dev);

	return 0;
}