Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1003827iob; Fri, 13 May 2022 19:17:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1me3HVncQia78EpiryrxXX81G64vf43fqel0MZ4IeG07ZHSMEcBlPFZBd9Nu+6u984XjQ X-Received: by 2002:a05:6000:1f03:b0:20c:4d9e:7400 with SMTP id bv3-20020a0560001f0300b0020c4d9e7400mr6034351wrb.257.1652494662481; Fri, 13 May 2022 19:17:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652494662; cv=none; d=google.com; s=arc-20160816; b=gCVYoqRPkC/U94giXrKxpEU0c2JTx3HzgGfTWC+FbelsQIr7lKXQU9QdTtURFjjl+F FhoV0AlDDxGOPcdsQLAFs/NhKBv6Xp/fKNDeYcvlyfXG62K/X90Ixsk6BGrLIRoTiNyO 4E8JYzkw+qSWhPgMYmtI8T/GbaPWGLFFnJTN+2STQfY2zsrpzJtDzljkl6HdBypBDo5B CvbufOTihr4kTk/QiTym0WKb3Lb6lGFOqWIoO/ya2qKLXEgCUpa/67Xt34DzTS+1b4Aa FVXRlsZoYpgzWAqUxXcYDWB9daz2nRWy/BjhDa5Vqtor1BG2Xu6pP4TpSFbnm5SJOK4k 2i6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=e/iolI9pZyck4VKU8wlWBiFyNuDoliCP0I07pUsZ64Q=; b=W8VEQmrLsfS87p5SpPoFi4W+xgmLbl8TwfFb0PuY36Rr5BB1/4jG5h80FuiqWrBusO tZ8/+QVzjeTYxkYxTMB34prRdx/NV/A5Rrifq7KtK8u4Mq7Il9wXJVybXx6yQMW1ypkD DtcqiIJhg8G/jjaAVEco4xbfiYONit7osG6BbAxD93EA6iLl0YDpVeWtDvsVbKawtI4N bEvg1H896CCjv9ryjLBKNTMaHNLabdl6dqu4eKe40EA3HptUtaQULNiqkC4Mj90fH8EW kqxPDuohtClDe/KRU0A+N9NsnDEEj3KKXItNlC6ljlwz77DmGLa16qkL/jPbZJrmYLF4 27FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FWx8hycs; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id o27-20020a5d58db000000b0020c45c12398si3438612wrf.309.2022.05.13.19.17.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 19:17:42 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FWx8hycs; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E78D34AD9E1; Fri, 13 May 2022 17:34:19 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382593AbiEMQvO (ORCPT + 99 others); Fri, 13 May 2022 12:51:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382689AbiEMQvA (ORCPT ); Fri, 13 May 2022 12:51:00 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C1895715E; Fri, 13 May 2022 09:50:48 -0700 (PDT) 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 43B8BB830F5; 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220505152738.1440249-1-nathan@kernel.org> X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 > >