Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2109741iob; Thu, 5 May 2022 16:08:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+W52MPbQcIn2fph8oekzqpUJZjgeK39VTIE0D5qOYbdX4dn+T9rCTCTpTHTsTr/CRjkzK X-Received: by 2002:a63:85c6:0:b0:3ab:4545:e29e with SMTP id u189-20020a6385c6000000b003ab4545e29emr316629pgd.573.1651792117772; Thu, 05 May 2022 16:08:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651792117; cv=none; d=google.com; s=arc-20160816; b=mMziNlhnEBkr461CZ4uera12AmfMFS5/+qL/ZIM5degK6plh6oUpA35TyiPgVjGV/D GeDm9YtqogWlRCSuF/Zjx5xc9VRV2ZmSR2l8U1+CQT+evGG46YQjW/0RwYJ1y4R6mo+L MvKASj2Ef+enezoc8RbBKOvXLuWmqg9uv96ceOSXHj+AT8DEUgjYpsowcFZTm/r9NDYu JEeekUrPiGn5mv+J4f/lyQ67bK1OATZ+IqfLRicsxsexJ83vClIwLQlx90YW+6ZfEfJy DWVNTqgis4RnID+/gLkN1vu7CXXLWumzTunfXPVIFDb6QtSkfBiTiMBYsOVfBoJMmMOU 21/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Jqhm47tjCEE07q7lqWhC3uuVLIIQqLky2l/x3XTpB7s=; b=nhAwxhgPznr72tvxcW7+o3Y0OwyicWjIWl94unMA296Z0UT5CWLlWaUpyvnrp6AZdJ K1ZLNLK4TLP2DtFqaH3Ggcan6Qb6hBjUAHCJjZz91cPfzh+gkrJEZ4dge2h8d2CzYhv7 vhM0oS52gXfnNXLP3RsofMGQ0YDjDT5EAm33HnvbVZkzv85pyFa69BFKKo5IyBT7BCna OnSlEKocJhoM9LRnzcQurJaXsoQvWJB/4S1iMaw0bt9SsChq5r9AdFeHZdLv7CfNy4z8 j+OzyZJH0MLHFugnQC4ZDS4PVc3SF4KfdAgwiepcEJ4DRHRsB1OvvarxWLEaflWh0xl7 n8Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IqTfK1DO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q2-20020a056a00084200b0050dfa520d24si3066357pfk.60.2022.05.05.16.08.22; Thu, 05 May 2022 16:08:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IqTfK1DO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357898AbiEEPbb (ORCPT + 99 others); Thu, 5 May 2022 11:31:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234496AbiEEPba (ORCPT ); Thu, 5 May 2022 11:31:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C039B50B1E; Thu, 5 May 2022 08:27:50 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 5A68761D0F; Thu, 5 May 2022 15:27:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EBE8EC385A8; Thu, 5 May 2022 15:27:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651764469; bh=mVIRt4yoiSxRUkECE7FwEEKVUQMrty6/i5Bfy9avcZw=; h=From:To:Cc:Subject:Date:From; b=IqTfK1DOBA9q7un4+7ST/1fhCQ5C0Fsqk1K9f4pSfp36DSjneyNQDm9bDfyD0H8rs UMIOn/Bl9GUzZ4Ust3lh4XKsbaCwlPB8CKP+d+Gi7p/hUMyVNucjoV/WIUnRULQlMA 9m2Pv2LlbxiruPNjFUNKcuN+MyYSaqnLbqBoczTRDgTmFCkiWusCOek8yWtPRuEjE8 w4zruAgWJAoq9nWgvDdXMZqpi3givElrdGT4+BwtSzalG8poEXzELnuSpqs8/+Z6gh g6uE6D5pHuqLH+Z5v329/qucwK4zPczzpRGh1ETfAhDJqrwssKDjFgFXcomwbzAd/z mqVzUvHmWKO8A== 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, Nathan Chancellor Subject: [PATCH] i2c: at91: Initialize dma_buf in at91_twi_xfer() Date: Thu, 5 May 2022 08:27:38 -0700 Message-Id: <20220505152738.1440249-1-nathan@kernel.org> X-Mailer: git-send-email 2.36.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 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