From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932555AbcH2UjF (ORCPT ); Mon, 29 Aug 2016 16:39:05 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:39583 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932447AbcH2UjB (ORCPT ); Mon, 29 Aug 2016 16:39:01 -0400 X-Sasl-enc: XaZ8/jX8nIBRBB5w4xsEPd+0k1BsvZ+DGHTWwKTeZEYS 1472503139 Date: Mon, 29 Aug 2016 13:38:57 -0700 Message-Id: In-Reply-To: References: From: John Youn To: John Youn To: Felipe Balbi To: Greg Kroah-Hartman To: linux-usb@vger.kernel.org To: linux-kernel@vger.kernel.org To: Stefan Wahren Cc: Robert Baldyga Subject: [PATCH 4/6] usb: dwc2: gadget: remove dead code from dwc2_hsotg_ep_enable() Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Robert Baldyga 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 Signed-off-by: John Youn --- 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 ac267fd..c8a182c 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -3043,22 +3043,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; -- 2.9.0