This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / drivers / char / watchdog / advantechwdt.c
index a92b3ae..4090794 100644 (file)
@@ -100,7 +100,7 @@ advwdt_disable(void)
 }
 
 static ssize_t
-advwdt_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
+advwdt_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)
@@ -130,6 +130,8 @@ advwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
          unsigned long arg)
 {
        int new_timeout;
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
        static struct watchdog_info ident = {
                .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
                .firmware_version = 1,
@@ -138,20 +140,20 @@ advwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 
        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:
        case WDIOC_GETBOOTSTATUS:
-         return put_user(0, (int *)arg);
+         return put_user(0, p);
 
        case WDIOC_KEEPALIVE:
          advwdt_ping();
          break;
 
        case WDIOC_SETTIMEOUT:
-         if (get_user(new_timeout, (int *)arg))
+         if (get_user(new_timeout, p))
                  return -EFAULT;
          if ((new_timeout < 1) || (new_timeout > 63))
                  return -EINVAL;
@@ -160,13 +162,13 @@ advwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
          /* Fall */
 
        case WDIOC_GETTIMEOUT:
-         return put_user(timeout, (int *)arg);
+         return put_user(timeout, p);
 
        case WDIOC_SETOPTIONS:
        {
          int options, retval = -EINVAL;
 
-         if (get_user(options, (int *)arg))
+         if (get_user(options, p))
            return -EFAULT;
 
          if (options & WDIOS_DISABLECARD) {