aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorJesper Juhl <jj@chaosbits.net>2012-01-16 16:42:10 -0500
committerFelipe Balbi <balbi@ti.com>2012-01-24 08:43:06 -0500
commit7983bc74fc0bc91f026c7ba0654b08073d843657 (patch)
tree37c424c5e8795a810f2eeefe35a7a35aa48a8b2d /drivers/usb
parent9e878a6bfa9e1cf70cf77caeca60a0465d77954b (diff)
usb: renesas: silence uninitialized variable report in usbhsg_recip_run_handle()
In drivers/usb/renesas_usbhs/mod_gadget.c::usbhsg_recip_run_handle() the Coverity Prevent checker currently flags a warning about possibly uninitialized use of 'ret' i usbhsg_recip_run_handle(). It does this since it assumes we take one of the non-default branches in the switch and then subsequently take the false branch in the 'if (func)' case below. This exact scenario will never happen, but Coverity can't see that for some reason. This patch initializes 'ret' to '0' when it is declared which should shut up this report and won't really hurt - so why not? At least then it's clear that 'ret' is always initialized.. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/renesas_usbhs/mod_gadget.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c
index 528691d5f3e2..7542aa94a462 100644
--- a/drivers/usb/renesas_usbhs/mod_gadget.c
+++ b/drivers/usb/renesas_usbhs/mod_gadget.c
@@ -425,7 +425,7 @@ static int usbhsg_recip_run_handle(struct usbhs_priv *priv,
425 struct usbhs_pipe *pipe; 425 struct usbhs_pipe *pipe;
426 int recip = ctrl->bRequestType & USB_RECIP_MASK; 426 int recip = ctrl->bRequestType & USB_RECIP_MASK;
427 int nth = le16_to_cpu(ctrl->wIndex) & USB_ENDPOINT_NUMBER_MASK; 427 int nth = le16_to_cpu(ctrl->wIndex) & USB_ENDPOINT_NUMBER_MASK;
428 int ret; 428 int ret = 0;
429 int (*func)(struct usbhs_priv *priv, struct usbhsg_uep *uep, 429 int (*func)(struct usbhs_priv *priv, struct usbhsg_uep *uep,
430 struct usb_ctrlrequest *ctrl); 430 struct usb_ctrlrequest *ctrl);
431 char *msg; 431 char *msg;