From: Armando Visconti Date: Thu, 13 Dec 2012 14:11:19 +0000 (+0100) Subject: usb: gadget zero: avoid unnecessary reinit of data in f_sourcesink X-Git-Tag: v3.9-rc1~126^2~43^2~47 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=32c9cf22fccb371745bde98e1da1c3aeb4bb9f36;p=~emulex%2Finfiniband.git usb: gadget zero: avoid unnecessary reinit of data in f_sourcesink In the IN case, since the USB request is allocated only when the source/sink function is started and never freed, the USB ept buffer needs to be initialized only at the beginning. This change results into a more performant g_zero module, especially when 'pattern=1' is selected. Signed-off-by: Armando Visconti Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/gadget/f_sourcesink.c b/drivers/usb/gadget/f_sourcesink.c index 102d49beb9d..de608864c6d 100644 --- a/drivers/usb/gadget/f_sourcesink.c +++ b/drivers/usb/gadget/f_sourcesink.c @@ -531,8 +531,7 @@ static void source_sink_complete(struct usb_ep *ep, struct usb_request *req) check_read_data(ss, req); if (pattern != 2) memset(req->buf, 0x55, req->length); - } else - reinit_write_data(ep, req); + } break; /* this endpoint is normally active while we're configured */