Skip to contentSkip to conversation

watchdog: ixp4xx_wdt: Fix address space warning

PATCH In review Guenter Roeck 2 participants 2 messages Sep 11, 2021 – Sep 17, 2021 Watchdog device drivers

lore
Share & tools
lore

Guenter Roeck

author maintainer
#0 lore raw

PATCH 1/1 watchdog: ixp4xx_wdt: Fix address space warning

sparse reports the following address space warning.

drivers/watchdog/ixp4xx_wdt.c:122:20: sparse:
incorrect type in assignment (different address spaces)
drivers/watchdog/ixp4xx_wdt.c:122:20: sparse:
expected void [noderef] __iomem *base
drivers/watchdog/ixp4xx_wdt.c:122:20: sparse:
got void *platform_data

Add a typecast to solve the problem.

Fixes 21a0a29d16c6 ("watchdog: ixp4xx: Rewrite driver to use core")
Cc Linus Walleij <[email protected]>
---
 drivers/watchdog/ixp4xx_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/ixp4xx_wdt.c +1 -1
index 2693ffb24ac7..31b03fa71341 100644
@@ -119,7 +119,7 @@ static int ixp4xx_wdt_probe(struct platform_device *pdev)
 	iwdt = devm_kzalloc(dev, sizeof(*iwdt), GFP_KERNEL);
 	if (!iwdt)
 		return -ENOMEM;
-	iwdt->base = dev->platform_data;
+	iwdt->base = (void __iomem *)dev->platform_data;
 
 	/*
 	 * Retrieve rate from a fixed clock from the device tree if
Signature · 1 line
2.33.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Guenter Roeck

sparse reports the following address space warning.

drivers/watchdog/ixp4xx_wdt.c:122:20: sparse:
incorrect type in assignment (different address spaces)
drivers/watchdog/ixp4xx_wdt.c:122:20: sparse:
expected void [noderef] __iomem *base
drivers/watchdog/ixp4xx_wdt.c:122:20: sparse:
got void *platform_data

Quoted 5 lines

Add a typecast to solve the problem.

Fixes 21a0a29d16c6 ("watchdog: ixp4xx: Rewrite driver to use core")
Cc Linus Walleij <[email protected]>

Thanks for fixing this!

Yours,
Linus Walleij