}
static ssize_t
-ibwdt_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
+ibwdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (count) {
if (!nowayout) {
size_t i;
unsigned long arg)
{
int i, new_margin;
+ void __user *argp = (void __user *)arg;
+ int __user *p = argp;
static struct watchdog_info ident = {
.options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
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;
break;
case WDIOC_GETSTATUS:
- return put_user(0, (int *) arg);
+ return put_user(0, p);
case WDIOC_KEEPALIVE:
ibwdt_ping();
break;
case WDIOC_SETTIMEOUT:
- if (get_user(new_margin, (int *)arg))
+ if (get_user(new_margin, p))
return -EFAULT;
if ((new_margin < 0) || (new_margin > 30))
return -EINVAL;
/* Fall */
case WDIOC_GETTIMEOUT:
- return put_user(wd_times[wd_margin], (int *)arg);
+ return put_user(wd_times[wd_margin], p);
break;
default:
/* Activate */
ibwdt_ping();
spin_unlock(&ibwdt_lock);
- return 0;
+ return nonseekable_open(inode, file);
}
static int