Skip to contentSkip to conversation

watchdong: kempld_wdt: Add __user annotation

PATCH In review Jingoo Han 3 participants 3 messages Aug 1, 2013 – Oct 26, 2013 Watchdog device drivers

lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/2 watchdong: 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>

---
 drivers/watchdog/kempld_wdt.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/watchdog/kempld_wdt.c +2 -2
index 491419e..d204258 100644
@@ -67,7 +67,7 @@ enum {
 	PRESCALER_12,
 };
 
-const u32 kempld_prescaler[] = {
+static const u32 kempld_prescaler[] = {
 	[PRESCALER_21] = (1 << 21) - 1,
 	[PRESCALER_17] = (1 << 17) - 1,
 	[PRESCALER_12] = (1 << 12) - 1,
@@ -361,7 +361,7 @@ static long kempld_wdt_ioctl(struct watchdog_device *wdd, unsigned int cmd,
 		ret = kempld_wdt_keepalive(wdd);
 		break;
 	case WDIOC_GETPRETIMEOUT:
-		ret = put_user(wdt_data->pretimeout, (int *)arg);
+		ret = put_user(wdt_data->pretimeout, (int __user *)arg);
 		break;
 	}
 
Signature · 1 line
1.7.10.4
maintainer Reviewed-by on v1 1/2
#1 lore raw
Quoted 10 lines · Jingoo Han

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>

#2 lore raw
In reply to Jingoo Han

Hi Jingoo,

Quoted 10 lines

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>

Added to linux-watchdog-next.

Kind regards,
Wim.