Commit 9063ff44 authored by Ingo van Lil's avatar Ingo van Lil Committed by Greg Kroah-Hartman

USB: gadget: dummy_hcd.c: fix nested switch statements

Fix a messed up combination of two nested switch statements in
drivers/usb/gadget/dummy_hcd.c.

According to the USB spec (section 5.8.3) the maximum packet size for bulk
endpoints can be 512 for high-speed devices and 8, 16, 32 or 64 for full-speed
devices.  Low-speed devices must not have bulk endpoints.
Signed-off-by: default avatarIngo van Lil <inguin@gmx.de>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 73d79aab
...@@ -365,16 +365,14 @@ dummy_enable (struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc) ...@@ -365,16 +365,14 @@ dummy_enable (struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc)
case USB_SPEED_HIGH: case USB_SPEED_HIGH:
if (max == 512) if (max == 512)
break; break;
/* conserve return statements */ goto done;
default: case USB_SPEED_FULL:
switch (max) { if (max == 8 || max == 16 || max == 32 || max == 64)
case 8: case 16: case 32: case 64:
/* we'll fake any legal size */ /* we'll fake any legal size */
break; break;
default: /* save a return statement */
case USB_SPEED_LOW: default:
goto done; goto done;
}
} }
break; break;
case USB_ENDPOINT_XFER_INT: case USB_ENDPOINT_XFER_INT:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment