]> err.no Git - linux-2.6/commitdiff
drivers/usb/core/devio.c: suppress warning with 64k PAGE_SIZE
authorAndrew Morton <akpm@linux-foundation.org>
Wed, 12 Mar 2008 20:32:24 +0000 (13:32 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 25 Apr 2008 04:16:41 +0000 (21:16 -0700)
drivers/usb/core/devio.c: In function 'proc_control':
drivers/usb/core/devio.c:657: warning: comparison is always false due to limited range of data type

Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/devio.c

index ae94176c64e41245efa23335d6a4787741ef9e7f..039ba23cc8b69809264794eca7281e2f7ecd5c79 100644 (file)
@@ -647,6 +647,7 @@ static int proc_control(struct dev_state *ps, void __user *arg)
        struct usbdevfs_ctrltransfer ctrl;
        unsigned int tmo;
        unsigned char *tbuf;
+       unsigned wLength;
        int i, j, ret;
 
        if (copy_from_user(&ctrl, arg, sizeof(ctrl)))
@@ -654,7 +655,8 @@ static int proc_control(struct dev_state *ps, void __user *arg)
        ret = check_ctrlrecip(ps, ctrl.bRequestType, ctrl.wIndex);
        if (ret)
                return ret;
-       if (ctrl.wLength > PAGE_SIZE)
+       wLength = ctrl.wLength;         /* To suppress 64k PAGE_SIZE warning */
+       if (wLength > PAGE_SIZE)
                return -EINVAL;
        tbuf = (unsigned char *)__get_free_page(GFP_KERNEL);
        if (!tbuf)