提交 c0e625c4 编写于 作者: F Felipe Balbi 提交者: Greg Kroah-Hartman

usb: host: xhci: convert several if() to a single switch statement

when getting endpoint type, a switch statement looks
better than a series of if () branches. There are no
functional changes with this patch, cleanup only.
Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 5abdc2e6
...@@ -1414,14 +1414,16 @@ static u32 xhci_get_endpoint_type(struct usb_host_endpoint *ep) ...@@ -1414,14 +1414,16 @@ static u32 xhci_get_endpoint_type(struct usb_host_endpoint *ep)
in = usb_endpoint_dir_in(&ep->desc); in = usb_endpoint_dir_in(&ep->desc);
if (usb_endpoint_xfer_control(&ep->desc)) switch (usb_endpoint_type(&ep->desc)) {
case USB_ENDPOINT_XFER_CONTROL:
return CTRL_EP; return CTRL_EP;
if (usb_endpoint_xfer_bulk(&ep->desc)) case USB_ENDPOINT_XFER_BULK:
return in ? BULK_IN_EP : BULK_OUT_EP; return in ? BULK_IN_EP : BULK_OUT_EP;
if (usb_endpoint_xfer_isoc(&ep->desc)) case USB_ENDPOINT_XFER_ISOC:
return in ? ISOC_IN_EP : ISOC_OUT_EP; return in ? ISOC_IN_EP : ISOC_OUT_EP;
if (usb_endpoint_xfer_int(&ep->desc)) case USB_ENDPOINT_XFER_INT:
return in ? INT_IN_EP : INT_OUT_EP; return in ? INT_IN_EP : INT_OUT_EP;
}
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册