Re: [PATCH 10/16 V3] USB: mv_udc: rewrite fifo flush

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/12/2011 12:49 PM, Neil Zhang wrote:

1: Add parameter check.
2: For controller endpointer, we need to flush in and out directions.

   Endpoint?

3: delete redundant code, make it more readable.

Signed-off-by: Neil Zhang<zhangwm@xxxxxxxxxxx>
---
  drivers/usb/gadget/mv_udc_core.c |   47 +++++++++++++++----------------------
  1 files changed, 19 insertions(+), 28 deletions(-)

diff --git a/drivers/usb/gadget/mv_udc_core.c b/drivers/usb/gadget/mv_udc_core.c
index 8bb8400..63d5e9a 100644
--- a/drivers/usb/gadget/mv_udc_core.c
+++ b/drivers/usb/gadget/mv_udc_core.c
@@ -681,37 +681,28 @@ static void mv_ep_fifo_flush(struct usb_ep *_ep)
  {
  	struct mv_udc *udc;
  	u32 bit_pos, direction;
-	struct mv_ep *ep = container_of(_ep, struct mv_ep, ep);
+	struct mv_ep *ep = NULL;

   Pointless initialization.

  	unsigned int loops;

+	if (!_ep)
+		return;
+
+	ep = container_of(_ep, struct mv_ep, ep);
+	if (!ep->desc)
+		return;
+
  	udc = ep->udc;
  	direction = ep_dir(ep);

WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux