From patchwork Tue Nov 24 08:49:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Min Guo X-Patchwork-Id: 11927445 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0950C63777 for ; Tue, 24 Nov 2020 08:50:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 70BC82075A for ; Tue, 24 Nov 2020 08:50:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730808AbgKXIuI (ORCPT ); Tue, 24 Nov 2020 03:50:08 -0500 Received: from Mailgw01.mediatek.com ([1.203.163.78]:65510 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1730519AbgKXIuI (ORCPT ); Tue, 24 Nov 2020 03:50:08 -0500 X-UUID: 9befa535e3a34f3e90b751a6e93804cb-20201124 X-UUID: 9befa535e3a34f3e90b751a6e93804cb-20201124 Received: from mtkcas35.mediatek.inc [(172.27.4.253)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 493252092; Tue, 24 Nov 2020 16:50:01 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by MTKMBS31N2.mediatek.inc (172.27.4.87) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 24 Nov 2020 16:49:58 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 24 Nov 2020 16:49:59 +0800 From: To: Bin Liu CC: Greg Kroah-Hartman , Alan Stern , Matthias Brugger , , , , , , Min Guo Subject: [PATCH v3] usb: musb: remove unused variable 'devctl' Date: Tue, 24 Nov 2020 16:49:55 +0800 Message-ID: <20201124084955.30270-1-min.guo@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-TM-SNTS-SMTP: 1E15F157744AEC9989CA4857FFB6D99450DE2308CA458A37E137A2127E0005752000:8 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Min Guo Remove unused 'devctl' variable to fix compile warnings: drivers/usb/musb/musbhsdma.c: In function 'dma_controller_irq': drivers/usb/musb/musbhsdma.c:324:8: warning: variable 'devctl' set but not used [-Wunused-but-set-variable] Signed-off-by: Min Guo --- changes in v3 suggested by Greg Kroah-Hartman: Add a comment. changes in v2 suggested by Alan Stern: Add void before musb_read to indicate that the register MUSB_DEVCTL was intended to be read and discarded. --- drivers/usb/musb/musbhsdma.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/usb/musb/musbhsdma.c b/drivers/usb/musb/musbhsdma.c index 0aacfc8be5a1..2a345b4ad015 100644 --- a/drivers/usb/musb/musbhsdma.c +++ b/drivers/usb/musb/musbhsdma.c @@ -321,8 +321,6 @@ irqreturn_t dma_controller_irq(int irq, void *private_data) musb_channel->channel.status = MUSB_DMA_STATUS_BUS_ABORT; } else { - u8 devctl; - addr = musb_read_hsdma_addr(mbase, bchannel); channel->actual_len = addr @@ -336,7 +334,11 @@ irqreturn_t dma_controller_irq(int irq, void *private_data) < musb_channel->len) ? "=> reconfig 0" : "=> complete"); - devctl = musb_readb(mbase, MUSB_DEVCTL); + /* + * Some hardware may need to read the + * MUSB_DEVCTL register once to take effect. + */ + (void)musb_readb(mbase, MUSB_DEVCTL); channel->status = MUSB_DMA_STATUS_FREE;