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

rtc: rv8803: 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-rv8803.c:648:18: error: cast to smaller integer type 'enum rv8803_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-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

authored by

Krzysztof Kozlowski and committed by
Alexandre Belloni
fbbeae0a 737055e1

+1 -2
+1 -2
drivers/rtc/rtc-rv8803.c
··· 645 645 mutex_init(&rv8803->flags_lock); 646 646 rv8803->client = client; 647 647 if (client->dev.of_node) { 648 - rv8803->type = (enum rv8803_type) 649 - of_device_get_match_data(&client->dev); 648 + rv8803->type = (uintptr_t)of_device_get_match_data(&client->dev); 650 649 } else { 651 650 const struct i2c_device_id *id = i2c_match_id(rv8803_id, client); 652 651