Merge to Fedora kernel-2.6.7-1.492
[linux-2.6.git] / drivers / sbus / char / riowatchdog.c
index f34c4a9..0e8d06e 100644 (file)
@@ -130,18 +130,19 @@ static int riowd_ioctl(struct inode *inode, struct file *filp,
        static struct watchdog_info info = {
                WDIOF_SETTIMEOUT, 0, "Natl. Semiconductor PC97317"
        };
+       void __user *argp = (void __user *)arg;
        unsigned int options;
        int new_margin;
 
        switch (cmd) {
        case WDIOC_GETSUPPORT:
-               if (copy_to_user((struct watchdog_info *) arg, &info, sizeof(info)))
+               if (copy_to_user(argp, &info, sizeof(info)))
                        return -EFAULT;
                break;
 
        case WDIOC_GETSTATUS:
        case WDIOC_GETBOOTSTATUS:
-               if (put_user(0, (int *) arg))
+               if (put_user(0, (int __user *)argp))
                        return -EFAULT;
                break;
 
@@ -150,7 +151,7 @@ static int riowd_ioctl(struct inode *inode, struct file *filp,
                break;
 
        case WDIOC_SETOPTIONS:
-               if (copy_from_user(&options, (void *) arg, sizeof(options)))
+               if (copy_from_user(&options, argp, sizeof(options)))
                        return -EFAULT;
 
                if (options & WDIOS_DISABLECARD)
@@ -163,7 +164,7 @@ static int riowd_ioctl(struct inode *inode, struct file *filp,
                break;
 
        case WDIOC_SETTIMEOUT:
-               if (get_user(new_margin, (int *)arg))
+               if (get_user(new_margin, (int __user *)argp))
                        return -EFAULT;
                if ((new_margin < 60) || (new_margin > (255 * 60)))
                    return -EINVAL;
@@ -172,7 +173,7 @@ static int riowd_ioctl(struct inode *inode, struct file *filp,
                /* Fall */
 
        case WDIOC_GETTIMEOUT:
-               return put_user(riowd_timeout * 60, (int *)arg);
+               return put_user(riowd_timeout * 60, (int __user *)argp);
 
        default:
                return -EINVAL;
@@ -181,7 +182,7 @@ static int riowd_ioctl(struct inode *inode, struct file *filp,
        return 0;
 }
 
-static ssize_t riowd_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
+static ssize_t riowd_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
 {
        if (ppos != &file->f_pos)
                return -ESPIPE;