From patchwork Wed Jun 8 15:27:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 12874154 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 72157C433EF for ; Wed, 8 Jun 2022 15:29:41 +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:MIME-Version:Message-Id:Date:Subject:Cc :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=2uDsaPft/cUsUxokDSeHDg4HKtzOg3l4KO7fABcfDng=; b=JiI42CmvXUVatm KDeXYt0xU1qjEpZ1qSW6+aN0jDlkzmkePyT1PS9ehERdsdoLMtphmeewR9t721bNFcbbCcvLXA/r0 z/Z2wU9JbsG6EOIwkOsF8p7osO5EFxBBHxeBnrNAWi/C8mVSOmV7xJI0Mi/u64imKHu6IKCndP5IM MgxshfPb5yXupWq3Js+N50CaFGvxpqu7kVZfwnZxCUSAkqwC/PVCtE8aGl8FLlQIO0m7fZxbYNGqt lv6nLMwRuM5uGJgsFkCQJ8kUFHeGAbW/x6xS5BTRvFlXFoDDj6qHaVLpoeJuVlqRYKxUq5Dp8ugjo JWOuB2FfSSmwky4P6fKQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyxbq-00E2I0-E1; Wed, 08 Jun 2022 15:28:38 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyxbn-00E2HO-5d for linux-arm-kernel@lists.infradead.org; Wed, 08 Jun 2022 15:28:36 +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 dfw.source.kernel.org (Postfix) with ESMTPS id 2CA3C61336; Wed, 8 Jun 2022 15:28:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4CA4C34116; Wed, 8 Jun 2022 15:28:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654702111; bh=xNLY7igwqhkEdX0LdFwkeYns5vg4pARM/9a9j++CR8Y=; h=From:To:Cc:Subject:Date:From; b=oIW5WJ1BJbIWgXH9K9gQyrMXg6UQZ+S78zAn3pGiCraQDI2d21f7n3ducnWT6Jsb2 Ezq/+xFsTFXe7Qn0ZuspuTXzbTehxaiQLN3Kb7NuJP6XNRWOAP1mJpAJ0qU6I7xtvD pjutZYEk66mXFu9qdTe2f7i/9q5xNcB4rW7vWg06yINH9sfyrrCL81BLRoejmkCqxG 91lPAEtLqx5AhyvnW6r3EbQEpnZYhujYqU1EzsZIf5EUCmQodWKQ/VbUmrOMsHxTzv owjfjejJSw3RmcuDKOph3ntVkVeo2a6LlrOBL3Om5ymxBpMulyBwmk1nvvNlYUaGCi IPSCVCd68vpIw== From: Nathan Chancellor To: Adrian Hunter , Al Cooper , Ulf Hansson , Kamal Dasu , Florian Fainelli Cc: bcm-kernel-feedback-list@broadcom.com, Nick Desaulniers , Tom Rix , Justin Stitt , Dan Carpenter , linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, llvm@lists.linux.dev, patches@lists.linux.dev, Nathan Chancellor , kernel test robot Subject: [PATCH] mmc: sdhci-brcmstb: Initialize base_clk to NULL in sdhci_brcmstb_probe() Date: Wed, 8 Jun 2022 08:27:57 -0700 Message-Id: <20220608152757.82529-1-nathan@kernel.org> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220608_082835_295908_B1412358 X-CRM114-Status: GOOD ( 14.30 ) 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 a few times along the lines of: drivers/mmc/host/sdhci-brcmstb.c:302:6: warning: variable 'base_clk' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (res) ^~~ drivers/mmc/host/sdhci-brcmstb.c:376:24: note: uninitialized use occurs here clk_disable_unprepare(base_clk); ^~~~~~~~ base_clk is used in the error path before it is initialized. Initialize it to NULL, as clk_disable_unprepare() calls clk_disable() and clk_unprepare(), which both handle NULL pointers gracefully. Fixes: 2cecaac1b21c ("mmc: sdhci-brcmstb: Add ability to increase max clock rate for 72116b0") Link: https://github.com/ClangBuiltLinux/linux/issues/1650 Reported-by: kernel test robot Signed-off-by: Nathan Chancellor Acked-by: Florian Fainelli Acked-by: Adrian Hunter --- drivers/mmc/host/sdhci-brcmstb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) base-commit: 10980053142d8a3e86eb4d3014574424b42b7a45 diff --git a/drivers/mmc/host/sdhci-brcmstb.c b/drivers/mmc/host/sdhci-brcmstb.c index f8dff8537920..28e9cf995c41 100644 --- a/drivers/mmc/host/sdhci-brcmstb.c +++ b/drivers/mmc/host/sdhci-brcmstb.c @@ -256,7 +256,7 @@ static int sdhci_brcmstb_probe(struct platform_device *pdev) struct sdhci_host *host; struct resource *iomem; struct clk *clk; - struct clk *base_clk; + struct clk *base_clk = NULL; int res; match = of_match_node(sdhci_brcm_of_match, pdev->dev.of_node);