Skip to contentSkip to conversation

drivers: usb: remove duplicate logical judgments in if

PATCH In review Minjie Du 2 participants 2 messages Jul 4, 2023 – Jul 5, 2023

Subsystems (2)
lore
Share & tools
lore

Minjie Du

author
#0 lore raw

PATCH 1/1 drivers: usb: remove duplicate logical judgments in if

Fix: delate duplicate judgments Does the judgment content of this if mean requesting confirmation twice? I'm not sure, Could you help check it out? Thank you!

---
 drivers/media/usb/go7007/go7007-usb.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/media/usb/go7007/go7007-usb.c +1 -2
index eeb85981e..c85e48e16 100644
@@ -653,8 +653,7 @@ static int go7007_usb_interface_reset(struct go7007 *go)
 	if (usb->board->flags & GO7007_USB_EZUSB) {
 		/* Reset buffer in EZ-USB */
 		pr_debug("resetting EZ-USB buffers\n");
-		if (go7007_usb_vendor_request(go, 0x10, 0, 0, NULL, 0, 0) < 0 ||
-		    go7007_usb_vendor_request(go, 0x10, 0, 0, NULL, 0, 0) < 0)
+		if (go7007_usb_vendor_request(go, 0x10, 0, 0, NULL, 0, 0) < 0)
 			return -1;
 
 		/* Reset encoder again */
Signature · 1 line
2.39.0
#1 lore raw

Hi Minjie,

Quoted 5 lines · Minjie Du

Fix: delate duplicate judgments Does the judgment content of this if mean requesting confirmation twice? I'm not sure, Could you help check it out? Thank you!

From what I can tell it tries to send the reset request a second time if the first attempt fails. Fair enough.

So let's leave this as-is.

Regards,

Hans

Quoted 20 lines
---
 drivers/media/usb/go7007/go7007-usb.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/media/usb/go7007/go7007-usb.c +1 -2
index eeb85981e..c85e48e16 100644
@@ -653,8 +653,7 @@ static int go7007_usb_interface_reset(struct go7007 *go)
 	if (usb->board->flags & GO7007_USB_EZUSB) {
 		/* Reset buffer in EZ-USB */
 		pr_debug("resetting EZ-USB buffers\n");
-		if (go7007_usb_vendor_request(go, 0x10, 0, 0, NULL, 0, 0) < 0 ||
-		    go7007_usb_vendor_request(go, 0x10, 0, 0, NULL, 0, 0) < 0)
+		if (go7007_usb_vendor_request(go, 0x10, 0, 0, NULL, 0, 0) < 0)
 			return -1;
 
 		/* Reset encoder again */