From patchwork Wed Oct 11 10:28:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 9999265 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2FABB602BF for ; Wed, 11 Oct 2017 10:29:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D779289B7 for ; Wed, 11 Oct 2017 10:29:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12429289E4; Wed, 11 Oct 2017 10:29:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A9D30289B7 for ; Wed, 11 Oct 2017 10:29:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=jHZmKpdSOX3WVsV2LcJqXI48bT0g7gxfxowzxoq9m/w=; b=rKilDitHrQUQLL ZTQzf0LaN9zNjNwfwsEn/rG+qdS4lJLUmctOrm/5gW1pKNTTYWoz+cD5/rGuNSczWuHq79M4d5ZDw 4EsyCmy8HQ5YOF6GxTuGj1vMmj1qmHfWtyUrG1dGHfgrhORcBm15ayx+8HTUaRVDHhRig5tQW5uF8 2WohtKg/Ck2lcOabqqPA32yaUCj6fEkzpFNc8Ek5Lb9fE+9uMYJDDWd5L4CNbzoQ3qencewNszEy/ Fz1C846X/ziNk1ROKVNwYAnX5UbZwDXWZqidj2opPa6erCfdbXjizdAtXZw4oiFUuhjtJ4LvnuUlr wo2+aizIjk9HMGENbgaw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e2EGA-00036t-0E; Wed, 11 Oct 2017 10:29:06 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e2EFv-0002q3-1D for linux-arm-kernel@lists.infradead.org; Wed, 11 Oct 2017 10:28:53 +0000 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1e2EFS-00006L-VN; Wed, 11 Oct 2017 10:28:23 +0000 From: Colin King To: Vinod Koul , Dan Williams , Maxime Coquelin , Alexandre Torgue , dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH][dma-next] dmaengine: stm32: remove redundant initialization of hwdesc Date: Wed, 11 Oct 2017 11:28:22 +0100 Message-Id: <20171011102822.19166-1-colin.king@canonical.com> X-Mailer: git-send-email 2.14.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171011_032851_279049_A124148A X-CRM114-Status: GOOD ( 10.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Colin Ian King hwdesc is being initialized to desc->hwdesc but this is never read as hwdesc is overwritten in a for-loop. Remove the redundant initialization and move the declaration of hwdesc into the for-loop. Cleans up clang warning: Value stored to 'hwdesc' during its initialization is never read Signed-off-by: Colin Ian King Acked-by: Pierre-Yves MORDRET --- drivers/dma/stm32-mdma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dma/stm32-mdma.c b/drivers/dma/stm32-mdma.c index 0db59a7e80e0..d3be6bffdf12 100644 --- a/drivers/dma/stm32-mdma.c +++ b/drivers/dma/stm32-mdma.c @@ -1252,13 +1252,13 @@ static size_t stm32_mdma_desc_residue(struct stm32_mdma_chan *chan, u32 curr_hwdesc) { struct stm32_mdma_device *dmadev = stm32_mdma_get_dev(chan); - struct stm32_mdma_hwdesc *hwdesc = desc->hwdesc; u32 cbndtr, residue, modulo, burst_size; int i; residue = 0; for (i = curr_hwdesc + 1; i < desc->count; i++) { - hwdesc = &desc->hwdesc[i]; + struct stm32_mdma_hwdesc *hwdesc = &desc->hwdesc[i]; + residue += STM32_MDMA_CBNDTR_BNDT(hwdesc->cbndtr); } cbndtr = stm32_mdma_read(dmadev, STM32_MDMA_CBNDTR(chan->id));