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

watchdog: dw_wdt: Add __user annotation

Added __user annotation to fix the following sparse warnings.

drivers/watchdog/dw_wdt.c:206:38: warning: incorrect type in argument 1 (different address spaces)
drivers/watchdog/dw_wdt.c:206:38: expected void [noderef] <asn:1>*to
drivers/watchdog/dw_wdt.c:206:38: got struct watchdog_info *<noident>
drivers/watchdog/dw_wdt.c:211:24: warning: incorrect type in initializer (different address spaces)
drivers/watchdog/dw_wdt.c:211:24: expected int const [noderef] <asn:1>*register __p
drivers/watchdog/dw_wdt.c:211:24: got int *<noident>

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Jamie Iles <jamie@jamieiles.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>

authored by

Jingoo Han and committed by
Wim Van Sebroeck
60295507 bc8fdfbe

+2 -2
+2 -2
drivers/watchdog/dw_wdt.c
··· 203 203 204 204 switch (cmd) { 205 205 case WDIOC_GETSUPPORT: 206 - return copy_to_user((struct watchdog_info *)arg, &dw_wdt_ident, 206 + return copy_to_user((void __user *)arg, &dw_wdt_ident, 207 207 sizeof(dw_wdt_ident)) ? -EFAULT : 0; 208 208 209 209 case WDIOC_GETSTATUS: 210 210 case WDIOC_GETBOOTSTATUS: 211 - return put_user(0, (int *)arg); 211 + return put_user(0, (int __user *)arg); 212 212 213 213 case WDIOC_KEEPALIVE: 214 214 dw_wdt_set_next_heartbeat();