Skip to contentSkip to conversation

usb-linux: Add missing break statement

PATCH In review Stefan Weil 3 participants 3 messages May 7, 2011 – May 9, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb-linux: Add missing break statement

cppcheck report:
usb-linux.c:661: warning: Redundant assignment of "len" in switch

Please check whether adding a break statement is the correct solution for this warning.

Cc Hans de Goede <[email protected]>
Cc Gerd Hoffmann <[email protected]>
---
 usb-linux.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
usb-linux.c +1 -0
index 36a01ea..0ef1d26 100644
@@ -659,6 +659,7 @@ static int usb_host_handle_iso_data(USBHostDevice *s, USBPacket *p, int in)
                         switch(errno) {
                         case ETIMEDOUT:
                             len = USB_RET_NAK;
+                            break;
                         case EPIPE:
                         default:
                             len = USB_RET_STALL;
Signature · 1 line
1.7.2.5
Acked-by on v1 1/1
#1 lore raw

Thanks, good catch.

Quoted 25 lines · Stefan Weil

cppcheck report:
usb-linux.c:661: warning: Redundant assignment of "len" in switch

Please check whether adding a break statement
is the correct solution for this warning.

Cc Hans de Goede<[email protected]>
Cc Gerd Hoffmann<[email protected]>
---
  usb-linux.c |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
usb-linux.c +1 -0
index 36a01ea..0ef1d26 100644
@@ -659,6 +659,7 @@ static int usb_host_handle_iso_data(USBHostDevice *s, USBPacket *p, int in)
                          switch(errno) {
                          case ETIMEDOUT:
                              len = USB_RET_NAK;
+                            break;
                          case EPIPE:
                          default:
                              len = USB_RET_STALL;