Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 20042
b: refs/heads/master
c: 73a09e6
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Feb 8, 2006
1 parent 42c5441 commit 4d1e47e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dad08dfc48529e3f907c2680f8b34f1fe2d75880
refs/heads/master: 73a09e626b9717851d3f7fd0230e401492ee326b
15 changes: 7 additions & 8 deletions trunk/drivers/char/watchdog/sbc_epx_c3.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static int epx_c3_release(struct inode *inode, struct file *file)
return 0;
}

static ssize_t epx_c3_write(struct file *file, const char *data,
static ssize_t epx_c3_write(struct file *file, const char __user *data,
size_t len, loff_t *ppos)
{
/* Refresh the timer. */
Expand All @@ -105,6 +105,7 @@ static int epx_c3_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
int options, retval = -EINVAL;
int __user *argp = (void __user *)arg;
static struct watchdog_info ident = {
.options = WDIOF_KEEPALIVEPING |
WDIOF_MAGICCLOSE,
Expand All @@ -114,20 +115,19 @@ static int epx_c3_ioctl(struct inode *inode, struct file *file,

switch (cmd) {
case WDIOC_GETSUPPORT:
if (copy_to_user((struct watchdog_info *)arg,
&ident, sizeof(ident)))
if (copy_to_user(argp, &ident, sizeof(ident)))
return -EFAULT;
return 0;
case WDIOC_GETSTATUS:
case WDIOC_GETBOOTSTATUS:
return put_user(0,(int *)arg);
return put_user(0, argp);
case WDIOC_KEEPALIVE:
epx_c3_pet();
return 0;
case WDIOC_GETTIMEOUT:
return put_user(WATCHDOG_TIMEOUT,(int *)arg);
case WDIOC_SETOPTIONS: {
if (get_user(options, (int *)arg))
return put_user(WATCHDOG_TIMEOUT, argp);
case WDIOC_SETOPTIONS:
if (get_user(options, argp))
return -EFAULT;

if (options & WDIOS_DISABLECARD) {
Expand All @@ -141,7 +141,6 @@ static int epx_c3_ioctl(struct inode *inode, struct file *file,
}

return retval;
}
default:
return -ENOIOCTLCMD;
}
Expand Down

0 comments on commit 4d1e47e

Please sign in to comment.