提交 ff66e3ce 编写于 作者: A Andrew Morton 提交者: Greg Kroah-Hartman

drivers/usb/core/devio.c: suppress warning with 64k PAGE_SIZE

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: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 8873aaa6
...@@ -647,6 +647,7 @@ static int proc_control(struct dev_state *ps, void __user *arg) ...@@ -647,6 +647,7 @@ static int proc_control(struct dev_state *ps, void __user *arg)
struct usbdevfs_ctrltransfer ctrl; struct usbdevfs_ctrltransfer ctrl;
unsigned int tmo; unsigned int tmo;
unsigned char *tbuf; unsigned char *tbuf;
unsigned wLength;
int i, j, ret; int i, j, ret;
if (copy_from_user(&ctrl, arg, sizeof(ctrl))) if (copy_from_user(&ctrl, arg, sizeof(ctrl)))
...@@ -654,7 +655,8 @@ static int proc_control(struct dev_state *ps, void __user *arg) ...@@ -654,7 +655,8 @@ static int proc_control(struct dev_state *ps, void __user *arg)
ret = check_ctrlrecip(ps, ctrl.bRequestType, ctrl.wIndex); ret = check_ctrlrecip(ps, ctrl.bRequestType, ctrl.wIndex);
if (ret) if (ret)
return ret; return ret;
if (ctrl.wLength > PAGE_SIZE) wLength = ctrl.wLength; /* To suppress 64k PAGE_SIZE warning */
if (wLength > PAGE_SIZE)
return -EINVAL; return -EINVAL;
tbuf = (unsigned char *)__get_free_page(GFP_KERNEL); tbuf = (unsigned char *)__get_free_page(GFP_KERNEL);
if (!tbuf) if (!tbuf)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册