From patchwork Fri Dec 22 18:06:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 13503716 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 211E4C41535 for ; Fri, 22 Dec 2023 19:17:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wrPnvyoqisTsqLn1+vn/Klu4wznnF4a8TX3w6PtfQDY=; b=HBJ+dS8eQM06dK iGm5f6KN9gLXTJACvZITo3Qo2mduvB4CDC+wvQG24RGF2f+25jwNNMfmVzJq1HfItugWEERKfsrM/ hOUEOeZW1Dkgd8VIIu8f76MLhutJVpifjfwdmIC6GQjjmj97c/gaKWm4uMQlJhDwgAPbHTnb9tAqg xQShS/NO27vUs9enA2jbh6PmYR26P3KusVu2SxKBxyUR0snBVe2lPiaCN69c+Q+WqMlPafKNAZHLP ABYh26qXihbu7hWTeyv8FAl+UC/V79sQ6tvaGU1J27Mp+201pYg9g5htkPSSXQ0/0c3pJ2+CWtzGJ uB+FvAK1bggdDxxKfeLA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rGl1F-006gfF-24; Fri, 22 Dec 2023 19:17:13 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rGjvA-006cWo-1W for linux-arm-kernel@lists.infradead.org; Fri, 22 Dec 2023 18:06:53 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id B076261CCD; Fri, 22 Dec 2023 18:06:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0766C433CB; Fri, 22 Dec 2023 18:06:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703268411; bh=1NacUmbt0EL+svtNIQXZRZLRDTEQIO2JqZEQWM/2bL4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=bOsqJa9Z2mcuE07Kuz2eSAWosTxeaDtF/q2v65sbHGA7ebEHuNTiSVjILmaTGKqm0 1viWAz+89BjuLjd0fo7Vf7K3baMl0HfFHMT5utV0/eEEGIGknPAqI5gKSvfOvXLKg0 vUQw6x7EXx3m8T4FzUvL2XZJh+vcW0xKLAvEGQyVB8TbJ0Y62++OOtbpnxIzfe+HcY AOlRCcjhwSokLf46G1Yk2dT8jCdV/pviSByjpFHe9iuvbEEbqCdSvU/7J42v+/0I6D Cbo0nRCToqM/HhW9CTqyLPxYuOG7/KLWd4gNyQdOcKgSeuQn6tUrwkUObA5IdfLhW8 pWWX19xVjAw+Q== From: Nathan Chancellor Date: Fri, 22 Dec 2023 11:06:45 -0700 Subject: [PATCH 2/2] dmaengine: xilinx: xdma: Fix initialization location of desc in xdma_channel_isr() MIME-Version: 1.0 Message-Id: <20231222-dma-xilinx-xdma-clang-fixes-v1-2-84a18ff184d2@kernel.org> References: <20231222-dma-xilinx-xdma-clang-fixes-v1-0-84a18ff184d2@kernel.org> In-Reply-To: <20231222-dma-xilinx-xdma-clang-fixes-v1-0-84a18ff184d2@kernel.org> To: lizhi.hou@amd.com, brian.xu@amd.com, raj.kumar.rampelli@amd.com, vkoul@kernel.org, jankul@alatek.krakow.pl Cc: dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, llvm@lists.linux.dev, patches@lists.linux.dev, Nathan Chancellor X-Mailer: b4 0.13-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=1437; i=nathan@kernel.org; h=from:subject:message-id; bh=1NacUmbt0EL+svtNIQXZRZLRDTEQIO2JqZEQWM/2bL4=; b=owGbwMvMwCUmm602sfCA1DTG02pJDKmtFyz1xZ3TE51/h8nMXfzmg90qwSjOtSXl6o9Pl51zm iDiani6o5SFQYyLQVZMkaX6sepxQ8M5ZxlvnJoEM4eVCWQIAxenAEykRJrhn8lFq0c/dhlvlqi7 stmgek3Xfq3Sl+pm5T0v1NoS4l7tCmL4X8m6dGvo+leXfKrMLm/T04zVfqj6yKvxqkqfoL3LB9Y rjAA= X-Developer-Key: i=nathan@kernel.org; a=openpgp; fpr=2437CB76E544CB6AB3D9DFD399739260CB6CB716 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231222_100652_555194_4313FEFE X-CRM114-Status: GOOD ( 10.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Clang warns (or errors with CONFIG_WERROR=y): drivers/dma/xilinx/xdma.c:894:3: error: variable 'desc' is uninitialized when used here [-Werror,-Wuninitialized] 894 | desc->error = true; | ^~~~ The initialization of desc was moved too far forward, move it back so that this assignment does not result in a potential crash at runtime while clearing up the warning. Closes: https://github.com/ClangBuiltLinux/linux/issues/1972 Fixes: 2f8f90cd2f8d ("dmaengine: xilinx: xdma: Implement interleaved DMA transfers") Signed-off-by: Nathan Chancellor --- drivers/dma/xilinx/xdma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/dma/xilinx/xdma.c b/drivers/dma/xilinx/xdma.c index d5b9fc3fd955..ee595d1ebc63 100644 --- a/drivers/dma/xilinx/xdma.c +++ b/drivers/dma/xilinx/xdma.c @@ -888,6 +888,8 @@ static irqreturn_t xdma_channel_isr(int irq, void *dev_id) if (ret) goto out; + desc = to_xdma_desc(vd); + st &= XDMA_CHAN_STATUS_MASK; if ((st & XDMA_CHAN_ERROR_MASK) || !(st & (CHAN_CTRL_IE_DESC_COMPLETED | CHAN_CTRL_IE_DESC_STOPPED))) { @@ -901,7 +903,6 @@ static irqreturn_t xdma_channel_isr(int irq, void *dev_id) if (ret) goto out; - desc = to_xdma_desc(vd); if (desc->interleaved_dma) { xchan->busy = false; desc->completed_desc_num += complete_desc_num;