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

regulator: lp872x: Fix Wvoid-pointer-to-enum-cast warning

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

lp872x.c:867:5: error: cast to smaller integer type 'enum lp872x_regulator_id' from 'void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230810111914.204847-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Mark Brown
c4189205 b29f42c6

+1 -1
+1 -1
drivers/regulator/lp872x.c
··· 864 864 865 865 for (i = 0; i < num_matches; i++) { 866 866 pdata->regulator_data[i].id = 867 - (enum lp872x_regulator_id)match[i].driver_data; 867 + (uintptr_t)match[i].driver_data; 868 868 pdata->regulator_data[i].init_data = match[i].init_data; 869 869 } 870 870 out: