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

watchdog: kempld_wdt: Add __user annotation

Added __user annotation to fix the following sparse warnings.
Also, it makes 'kempld_prescaler' static because it is used
only in this file.

drivers/watchdog/kempld_wdt.c:70:11: warning: symbol 'kempld_prescaler' was not declared. Should it be static?
drivers/watchdog/kempld_wdt.c:364:23: warning: incorrect type in initializer (different address spaces)
drivers/watchdog/kempld_wdt.c:364:23: expected int const [noderef] <asn:1>*register __p
drivers/watchdog/kempld_wdt.c:364:23: got int *<noident>

Signed-off-by: Jingoo Han <jg1.han@samsung.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
b3970bde 60295507

+2 -2
+2 -2
drivers/watchdog/kempld_wdt.c
··· 67 67 PRESCALER_12, 68 68 }; 69 69 70 - const u32 kempld_prescaler[] = { 70 + static const u32 kempld_prescaler[] = { 71 71 [PRESCALER_21] = (1 << 21) - 1, 72 72 [PRESCALER_17] = (1 << 17) - 1, 73 73 [PRESCALER_12] = (1 << 12) - 1, ··· 361 361 ret = kempld_wdt_keepalive(wdd); 362 362 break; 363 363 case WDIOC_GETPRETIMEOUT: 364 - ret = put_user(wdt_data->pretimeout, (int *)arg); 364 + ret = put_user(wdt_data->pretimeout, (int __user *)arg); 365 365 break; 366 366 } 367 367