Commit 3a69e579 authored by Ian Campbell's avatar Ian Campbell Committed by Wim Van Sebroeck

[WATCHDOG] sa1100_wdt.c sparse clean (2)

The following makes drivers/char/watchdog/sa1100_wdt.c sparse clean.
(similar to the other watchdog drivers)
Signed-off-by: default avatarIan Campbell <icampbell@arcom.com>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent bc6d7fdf
...@@ -93,23 +93,25 @@ static int sa1100dog_ioctl(struct inode *inode, struct file *file, ...@@ -93,23 +93,25 @@ static int sa1100dog_ioctl(struct inode *inode, struct file *file,
{ {
int ret = -ENOIOCTLCMD; int ret = -ENOIOCTLCMD;
int time; int time;
void __user *argp = (void __user *)arg;
int __user *p = argp;
switch (cmd) { switch (cmd) {
case WDIOC_GETSUPPORT: case WDIOC_GETSUPPORT:
ret = copy_to_user((struct watchdog_info __user *)arg, &ident, ret = copy_to_user(argp, &ident,
sizeof(ident)) ? -EFAULT : 0; sizeof(ident)) ? -EFAULT : 0;
break; break;
case WDIOC_GETSTATUS: case WDIOC_GETSTATUS:
ret = put_user(0, (int __user *)arg); ret = put_user(0, p);
break; break;
case WDIOC_GETBOOTSTATUS: case WDIOC_GETBOOTSTATUS:
ret = put_user(boot_status, (int __user *)arg); ret = put_user(boot_status, p);
break; break;
case WDIOC_SETTIMEOUT: case WDIOC_SETTIMEOUT:
ret = get_user(time, (int __user *)arg); ret = get_user(time, p);
if (ret) if (ret)
break; break;
...@@ -123,7 +125,7 @@ static int sa1100dog_ioctl(struct inode *inode, struct file *file, ...@@ -123,7 +125,7 @@ static int sa1100dog_ioctl(struct inode *inode, struct file *file,
/*fall through*/ /*fall through*/
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
ret = put_user(pre_margin / OSCR_FREQ, (int __user *)arg); ret = put_user(pre_margin / OSCR_FREQ, p);
break; break;
case WDIOC_KEEPALIVE: case WDIOC_KEEPALIVE:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment