aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Hädicke <felixhaedicke@web.de>2016-11-03 19:23:26 -0400
committerFelipe Balbi <felipe.balbi@linux.intel.com>2016-11-18 06:50:37 -0500
commit05e78c6933d613a7da0d0473f4c19c865af04c2c (patch)
treeaf263e55357cdce6dc940c0ae0c32eca934a252c
parenta25f0944ba9b1d8a6813fd6f1a86f1bd59ac25a6 (diff)
usb: gadget: f_fs: fix wrong parenthesis in ffs_func_req_match()
Properly check the return code of ffs_func_revmap_intf() and ffs_func_revmap_ep() for a non-negative value. Instead of checking the return code, the comparison was performed for the last parameter of the function calls, because of wrong parenthesis. This also fixes the following static checker warning: drivers/usb/gadget/function/f_fs.c:3152 ffs_func_req_match() warn: always true condition '(((creq->wIndex)) >= 0) => (0-u16max >= 0)' Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Felix Hädicke <felixhaedicke@web.de> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-rw-r--r--drivers/usb/gadget/function/f_fs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
index e40d47d47d82..17989b72cdae 100644
--- a/drivers/usb/gadget/function/f_fs.c
+++ b/drivers/usb/gadget/function/f_fs.c
@@ -3225,11 +3225,11 @@ static bool ffs_func_req_match(struct usb_function *f,
3225 3225
3226 switch (creq->bRequestType & USB_RECIP_MASK) { 3226 switch (creq->bRequestType & USB_RECIP_MASK) {
3227 case USB_RECIP_INTERFACE: 3227 case USB_RECIP_INTERFACE:
3228 return ffs_func_revmap_intf(func, 3228 return (ffs_func_revmap_intf(func,
3229 le16_to_cpu(creq->wIndex) >= 0); 3229 le16_to_cpu(creq->wIndex)) >= 0);
3230 case USB_RECIP_ENDPOINT: 3230 case USB_RECIP_ENDPOINT:
3231 return ffs_func_revmap_ep(func, 3231 return (ffs_func_revmap_ep(func,
3232 le16_to_cpu(creq->wIndex) >= 0); 3232 le16_to_cpu(creq->wIndex)) >= 0);
3233 default: 3233 default:
3234 return (bool) (func->ffs->user_flags & 3234 return (bool) (func->ffs->user_flags &
3235 FUNCTIONFS_ALL_CTRL_RECIP); 3235 FUNCTIONFS_ALL_CTRL_RECIP);