Skip to content

Commit c418920

Browse files
krzkbroonie
authored andcommitted
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>
1 parent b29f42c commit c418920

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/regulator/lp872x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ static struct lp872x_platform_data
864864

865865
for (i = 0; i < num_matches; i++) {
866866
pdata->regulator_data[i].id =
867-
(enum lp872x_regulator_id)match[i].driver_data;
867+
(uintptr_t)match[i].driver_data;
868868
pdata->regulator_data[i].init_data = match[i].init_data;
869869
}
870870
out:

0 commit comments

Comments
 (0)