Skip to content

Commit

Permalink
[WATCHDOG] sa1100_wdt.c sparse clean (2)
Browse files Browse the repository at this point in the history
The following makes drivers/char/watchdog/sa1100_wdt.c sparse clean.
(similar to the other watchdog drivers)

Signed-off-by: Ian Campbell <icampbell@arcom.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
  • Loading branch information
Ian Campbell authored and Wim Van Sebroeck committed Feb 12, 2006
1 parent bc6d7fd commit 3a69e57
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions drivers/char/watchdog/sa1100_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,23 +93,25 @@ static int sa1100dog_ioctl(struct inode *inode, struct file *file,
{
int ret = -ENOIOCTLCMD;
int time;
void __user *argp = (void __user *)arg;
int __user *p = argp;

switch (cmd) {
case WDIOC_GETSUPPORT:
ret = copy_to_user((struct watchdog_info __user *)arg, &ident,
ret = copy_to_user(argp, &ident,
sizeof(ident)) ? -EFAULT : 0;
break;

case WDIOC_GETSTATUS:
ret = put_user(0, (int __user *)arg);
ret = put_user(0, p);
break;

case WDIOC_GETBOOTSTATUS:
ret = put_user(boot_status, (int __user *)arg);
ret = put_user(boot_status, p);
break;

case WDIOC_SETTIMEOUT:
ret = get_user(time, (int __user *)arg);
ret = get_user(time, p);
if (ret)
break;

Expand All @@ -123,7 +125,7 @@ static int sa1100dog_ioctl(struct inode *inode, struct file *file,
/*fall through*/

case WDIOC_GETTIMEOUT:
ret = put_user(pre_margin / OSCR_FREQ, (int __user *)arg);
ret = put_user(pre_margin / OSCR_FREQ, p);
break;

case WDIOC_KEEPALIVE:
Expand Down

0 comments on commit 3a69e57

Please sign in to comment.