All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Baldyga <r.baldyga@samsung.com>
To: balbi@ti.com, johnyoun@synopsys.com
Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, m.szyprowski@samsung.com,
	b.zolnierkie@samsung.com, Robert Baldyga <r.baldyga@samsung.com>
Subject: [PATCH v2 4/5] usb: dwc2: gadget: remove dead code from dwc2_hsotg_ep_enable()
Date: Wed, 03 Feb 2016 12:36:33 +0100	[thread overview]
Message-ID: <1454499394-4610-5-git-send-email-r.baldyga@samsung.com> (raw)
In-Reply-To: <1454499394-4610-1-git-send-email-r.baldyga@samsung.com>

Since FIFO is always freed in dwc2_hsotg_ep_disable(), ep->fifo_index
is always 0 in dwc2_hsotg_ep_enable(), hence code inside if() block is
never executed.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
---
 drivers/usb/dwc2/gadget.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index f01a936..8f9d45b 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -2702,22 +2702,11 @@ static int dwc2_hsotg_ep_enable(struct usb_ep *ep,
 		break;
 	}
 
-	/* If fifo is already allocated for this ep */
-	if (hs_ep->fifo_index) {
-		size =  hs_ep->ep.maxpacket * hs_ep->mc;
-		/* If bigger fifo is required deallocate current one */
-		if (size > hs_ep->fifo_size) {
-			hsotg->fifo_map &= ~(1 << hs_ep->fifo_index);
-			hs_ep->fifo_index = 0;
-			hs_ep->fifo_size = 0;
-		}
-	}
-
 	/*
 	 * if the hardware has dedicated fifos, we must give each IN EP
 	 * a unique tx-fifo even if it is non-periodic.
 	 */
-	if (dir_in && hsotg->dedicated_fifos && !hs_ep->fifo_index) {
+	if (dir_in && hsotg->dedicated_fifos) {
 		u32 fifo_index = 0;
 		u32 fifo_size = UINT_MAX;
 		size = hs_ep->ep.maxpacket*hs_ep->mc;
-- 
1.9.1

  parent reply	other threads:[~2016-02-03 11:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-03 11:36 [PATCH v2 0/5] usb: dwc2: gadget: Fix TX FIFO handling Robert Baldyga
2016-02-03 11:36 ` [PATCH v2 1/5] usb: dwc2: gadget: use ep->fifo_index in context of FIFO registers Robert Baldyga
2016-02-04 12:25   ` Vahram Aharonyan
2017-01-09  8:13     ` Morgan Chang
2016-02-03 11:36 ` [PATCH v2 2/5] usb: dwc2: gadget: fix TX FIFO size and address initialization Robert Baldyga
2016-02-04 13:07   ` Vahram Aharonyan
2016-02-03 11:36 ` [PATCH v2 3/5] usb: dwc2: gadget: change variable name to more meaningful Robert Baldyga
2016-02-03 11:36 ` Robert Baldyga [this message]
2016-02-03 11:36 ` [PATCH v2 5/5] usb: dwc2: gadget: free TX FIFO after killing requests Robert Baldyga

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1454499394-4610-5-git-send-email-r.baldyga@samsung.com \
    --to=r.baldyga@samsung.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=johnyoun@synopsys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.