]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] drivers/char/pcwd.c
authorRob Radez <rob@osinvestor.com>
Mon, 11 Feb 2002 13:09:30 +0000 (05:09 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Mon, 11 Feb 2002 13:09:30 +0000 (05:09 -0800)
This patch to drivers/char/pcwd.c against 2.5.4 does two things:
a) Makes one code snippet more consistent with the rest of the code, and
b) Makes it possible for this code to actually work

Nearly the same patch against 2.4 was reviewed by Alan, and, well, the
maintainer seems to have disappeared.  It's also looking like no one uses
this driver much either.

Regards,
Rob Radez

drivers/char/pcwd.c

index a0d4bdc29fa96b08a24031e97d468ffd162d4a40..791c15d52f1170704e38132fc028f4d85f4f79cf 100644 (file)
@@ -238,7 +238,7 @@ static void pcwd_send_heartbeat(void)
 static int pcwd_ioctl(struct inode *inode, struct file *file,
                      unsigned int cmd, unsigned long arg)
 {
-       int i, cdat, rv;
+       int cdat, rv;
        static struct watchdog_info ident=
        {
                WDIOF_OVERHEAT|WDIOF_CARDRESET,
@@ -251,8 +251,9 @@ static int pcwd_ioctl(struct inode *inode, struct file *file,
                return -ENOTTY;
 
        case WDIOC_GETSUPPORT:
-               i = copy_to_user((void*)arg, &ident, sizeof(ident));
-               return i ? -EFAULT : 0;
+               if(copy_to_user((void*)arg, &ident, sizeof(ident)))
+                       return -EFAULT;
+               return 0;
 
        case WDIOC_GETSTATUS:
                spin_lock(&io_lock);
@@ -575,7 +576,6 @@ static int __init pcwatchdog_init(void)
        printk("pcwd: v%s Ken Hollis (kenji@bitgate.com)\n", WD_VER);
 
        /* Initial variables */
-       set_bit( 0, &open_allowed );
        supports_temp = 0;
        mode_debug = 0;
        temp_panic = 0;