From mboxrd@z Thu Jan 1 00:00:00 1970 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 A1B85C433F5 for ; Fri, 13 May 2022 16:52:02 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YLrSmTeGMgwYwcD5qk57yPibtED2VQ5LwPfYCKgJhnk=; b=4ZViiHk0ZwY7mk ilhh6IaWZxNmbDoha4V8vB+58QXnAtmuwMtKW9riCoEdmdVLJ08K41Ky+nJu/poiIRu4ofqxowwWH aVgoB6mcop9nY2SbgrBbvYrY4MOPFU0ULwPOPlWNCsG+JpPWl+BfuHh/d6JY52pYPfJQwXPjvd1W8 iyPM2rMJYT10Age5VI4pgqiMGWMrFweoEedT+9oK87NwLkzXU+NdFreXdUGTA5axGZeDfgfbodydB rQJYT+uEMzzrs6j33u+0wP2Gjfayxx23DzC3HAeYWGsbt9hfC7fD5JnLmKMVDL1lNVCH7t5NKOrlA 0ieAqRDrCSn3LeImOpAw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1npYVB-00GuNx-Jb; Fri, 13 May 2022 16:50:53 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1npYV9-00GuMt-3G for linux-arm-kernel@lists.infradead.org; Fri, 13 May 2022 16:50:52 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 40212B82D6E; Fri, 13 May 2022 16:50:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55E38C34100; Fri, 13 May 2022 16:50:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652460646; bh=/SJ3ynd9dz9LD1HOGD+pWoI3QNdCc8TOcMx8HqshsiA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FWx8hycsPbrgaLFKWt2JwzZY0bYAb1+FpugiFBuLm+BnsqE0Llq7YizVun+Rk8yE4 1OOP+YSbHF7FgLKyFoqhPQhNFHGhE+j+2ODKShLe8eRUC90CEnsrP2R3mvusn93PGd SNR0LyUfowfqZXQbk6Sd126/qk+Qo0Lbf5VlDonh41sx4p1ryEFvEMTrbdIHyWf1C1 v1BYUIgPpEbh9An+KR1i48Cb+RoGhBLDNljvSYefiH4kqRBjOjcNWSUuSsC24wSsM2 X3E8IP8pq1idp/1xat/7JO5/hbpEbNw5Ma92fLnQw1sVfV31PC3anNgD+z0xek+f2C 3yoBg9azSKDxw== Date: Fri, 13 May 2022 09:50:43 -0700 From: Nathan Chancellor To: Codrin Ciubotariu , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Wolfram Sang , Michael Walle Cc: Nick Desaulniers , Tom Rix , linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH] i2c: at91: Initialize dma_buf in at91_twi_xfer() Message-ID: References: <20220505152738.1440249-1-nathan@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220505152738.1440249-1-nathan@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220513_095051_314280_1D1617A3 X-CRM114-Status: GOOD ( 19.65 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Ping? This is a pretty obvious fix and this warning turns into an error with CONFIG_WERROR so some of our -next builds have been broken for over a week now. On Thu, May 05, 2022 at 08:27:38AM -0700, Nathan Chancellor wrote: > Clang warns: > > drivers/i2c/busses/i2c-at91-master.c:707:6: warning: variable 'dma_buf' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] > if (dev->use_dma) { > ^~~~~~~~~~~~ > drivers/i2c/busses/i2c-at91-master.c:717:27: note: uninitialized use occurs here > i2c_put_dma_safe_msg_buf(dma_buf, m_start, !ret); > ^~~~~~~ > > Initialize dma_buf to NULL, as i2c_put_dma_safe_msg_buf() is a no-op > when the first argument is NULL, which will work for the !dev->use_dma > case. > > Fixes: 03fbb903c8bf ("i2c: at91: use dma safe buffers") > Link: https://github.com/ClangBuiltLinux/linux/issues/1629 > Signed-off-by: Nathan Chancellor > --- > drivers/i2c/busses/i2c-at91-master.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/i2c/busses/i2c-at91-master.c b/drivers/i2c/busses/i2c-at91-master.c > index 5eca3b3bb609..c0c35785a0dc 100644 > --- a/drivers/i2c/busses/i2c-at91-master.c > +++ b/drivers/i2c/busses/i2c-at91-master.c > @@ -656,7 +656,7 @@ static int at91_twi_xfer(struct i2c_adapter *adap, struct i2c_msg *msg, int num) > unsigned int_addr_flag = 0; > struct i2c_msg *m_start = msg; > bool is_read; > - u8 *dma_buf; > + u8 *dma_buf = NULL; > > dev_dbg(&adap->dev, "at91_xfer: processing %d messages:\n", num); > > > base-commit: a181b8d187319bf265a2019ddde856a3d2f107a6 > -- > 2.36.0 > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel