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

rtc: rs5c372: fix Wvoid-pointer-to-enum-cast warning

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

rtc-rs5c372.c:829:19: error: cast to smaller integer type 'enum rtc_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230810103902.151145-4-krzysztof.kozlowski@linaro.org
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

authored by

Krzysztof Kozlowski and committed by
Alexandre Belloni
e5aabfbc 4ebbd463

+1 -2
+1 -2
drivers/rtc/rtc-rs5c372.c
··· 826 826 rs5c372->client = client; 827 827 i2c_set_clientdata(client, rs5c372); 828 828 if (client->dev.of_node) { 829 - rs5c372->type = (enum rtc_type) 830 - of_device_get_match_data(&client->dev); 829 + rs5c372->type = (uintptr_t)of_device_get_match_data(&client->dev); 831 830 } else { 832 831 const struct i2c_device_id *id = i2c_match_id(rs5c372_id, client); 833 832 rs5c372->type = id->driver_data;