This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / drivers / char / watchdog / i8xx_tco.c
index efe3c1d..8a63f7f 100644 (file)
@@ -212,7 +212,7 @@ static int i8xx_tco_release (struct inode *inode, struct file *file)
        return 0;
 }
 
-static ssize_t i8xx_tco_write (struct file *file, const char *data,
+static ssize_t i8xx_tco_write (struct file *file, const char __user *data,
                              size_t len, loff_t * ppos)
 {
        /*  Can't seek (pwrite) on this device  */
@@ -249,6 +249,8 @@ static int i8xx_tco_ioctl (struct inode *inode, struct file *file,
 {
        int new_options, retval = -EINVAL;
        int new_heartbeat;
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
        static struct watchdog_info ident = {
                .options =              WDIOF_SETTIMEOUT |
                                        WDIOF_KEEPALIVEPING |
@@ -259,12 +261,12 @@ static int i8xx_tco_ioctl (struct inode *inode, struct file *file,
 
        switch (cmd) {
                case WDIOC_GETSUPPORT:
-                       return copy_to_user((struct watchdog_info *) arg, &ident,
+                       return copy_to_user(argp, &ident,
                                sizeof (ident)) ? -EFAULT : 0;
 
                case WDIOC_GETSTATUS:
                case WDIOC_GETBOOTSTATUS:
-                       return put_user (0, (int *) arg);
+                       return put_user (0, p);
 
                case WDIOC_KEEPALIVE:
                        tco_timer_keepalive ();
@@ -272,7 +274,7 @@ static int i8xx_tco_ioctl (struct inode *inode, struct file *file,
 
                case WDIOC_SETOPTIONS:
                {
-                       if (get_user (new_options, (int *) arg))
+                       if (get_user (new_options, p))
                                return -EFAULT;
 
                        if (new_options & WDIOS_DISABLECARD) {
@@ -291,7 +293,7 @@ static int i8xx_tco_ioctl (struct inode *inode, struct file *file,
 
                case WDIOC_SETTIMEOUT:
                {
-                       if (get_user(new_heartbeat, (int *) arg))
+                       if (get_user(new_heartbeat, p))
                                return -EFAULT;
 
                        if (tco_timer_set_heartbeat(new_heartbeat))
@@ -302,7 +304,7 @@ static int i8xx_tco_ioctl (struct inode *inode, struct file *file,
                }
 
                case WDIOC_GETTIMEOUT:
-                       return put_user(heartbeat, (int *)arg);
+                       return put_user(heartbeat, p);
 
                default:
                        return -ENOIOCTLCMD;