2019-06-26 16:35:49

by Colin King

[permalink] [raw]
Subject: [PATCH] usb: gadget: udc: renesas_usb3: remove redundant assignment to ret

From: Colin Ian King <[email protected]>

Variable ret is being initialized with a value that is never read and
ret is being re-assigned immediately after the initialization in both
paths of an if statement. This is redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <[email protected]>
---
drivers/usb/gadget/udc/renesas_usb3.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c
index 5a960fce31c5..87062d22134d 100644
--- a/drivers/usb/gadget/udc/renesas_usb3.c
+++ b/drivers/usb/gadget/udc/renesas_usb3.c
@@ -1168,7 +1168,7 @@ static void usb3_set_status_stage(struct renesas_usb3_ep *usb3_ep,
static void usb3_p0_xfer(struct renesas_usb3_ep *usb3_ep,
struct renesas_usb3_request *usb3_req)
{
- int ret = -EAGAIN;
+ int ret;

if (usb3_ep->dir_in)
ret = usb3_write_pipe(usb3_ep, usb3_req, USB3_P0_WRITE);
--
2.20.1


2019-06-27 01:17:30

by Yoshihiro Shimoda

[permalink] [raw]
Subject: RE: [PATCH] usb: gadget: udc: renesas_usb3: remove redundant assignment to ret

Hi Colin,

> From: Colin King, Sent: Thursday, June 27, 2019 1:35 AM
>
> From: Colin Ian King <[email protected]>
>
> Variable ret is being initialized with a value that is never read and
> ret is being re-assigned immediately after the initialization in both
> paths of an if statement. This is redundant and can be removed.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <[email protected]>

Thank you for the patch!

Reviewed-by: Yoshihiro Shimoda <[email protected]>

Best regards,
Yoshihiro Shimoda