[PATCH 3/4] rtc: jz4740: fix Wvoid-pointer-to-enum-cast warning

From: Krzysztof Kozlowski
Date: Thu Aug 10 2023 - 06:39:20 EST


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

rtc-jz4740.c:352:14: error: cast to smaller integer type 'enum jz4740_rtc_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>
---
drivers/rtc/rtc-jz4740.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-jz4740.c b/drivers/rtc/rtc-jz4740.c
index 36453b008139..84e0b3bfa71f 100644
--- a/drivers/rtc/rtc-jz4740.c
+++ b/drivers/rtc/rtc-jz4740.c
@@ -349,7 +349,7 @@ static int jz4740_rtc_probe(struct platform_device *pdev)
if (!rtc)
return -ENOMEM;

- rtc->type = (enum jz4740_rtc_type)device_get_match_data(dev);
+ rtc->type = (uintptr_t)device_get_match_data(dev);

irq = platform_get_irq(pdev, 0);
if (irq < 0)
--
2.34.1