From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7AC457A for ; Wed, 15 Jun 2022 17:33:25 +0000 (UTC) Received: by mail-lf1-f48.google.com with SMTP id c4so19967980lfj.12 for ; Wed, 15 Jun 2022 10:33:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hd/cGjQ2Xjd6LDpefMqiTBtHv/N383B1PfAFMpFqhy4=; b=ASUCE8+CrV643MgfwX5XdEPd6FlLM4uc/R29PsZSfVTEMoidZJyYKETJnkcSaq/IKA +eA9/hNGuhv7cKf6dfWNuj4XaVHGdkVdkHgMAK3VvbsHc6Ih/EKXWeKHparRqcsI/5tD koAls765sRUN+OJPW9AHvNm29+2wv7BtO0IfMeM/5ontyyEdZFRx49y3t/W4LoS6fLwh ttAr+WadM4xaq8cgT0beYDVpS/PhrA6VwMgdHs/TByUlpS2kAR//ZUAYQs2ndtDDtA9z 3J/rC2KnaSpWtoz+CeJs1NgAKvoITWJyMMcHJNuAU/TOWnZY4AFQoYDw8Llgg3q7LDzw MJpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hd/cGjQ2Xjd6LDpefMqiTBtHv/N383B1PfAFMpFqhy4=; b=najuv4gON0fHRlCVhcUiHZsa1zsS4DVTUIsGnsLyPttPz+iijY8AwFtvoK5h4i9Qm0 jTWsuqAa+PflFtZvCBG6vQn2LBT+HeNKFpRcZSd4Yk3f4EPMjbSn9qTfskvcFZ8uT55E qq4ko6KVMDzkarvvLv59yPU/qQUam4eBtRvURRWgvSN5w4nOKFysutzVVDdvEeO08HOa 04es/pWJp3V3XIGuJaochQMyVFjSgr/1bPuIJKhrJYTT0DNv5Gg4mEEyBNv0RsIc0k/G aDnPwvcAFJ6OrSCLMKBTbAdUM8KQNHXe6nPel18ijuuU4psRWoQkOe3POz4Swc/spVg7 WnKA== X-Gm-Message-State: AJIora+IjQHBctYbIBrOE5f6jI/58syrQzUltrflCke3KI6DYTsCZSsx hLiw6KY+HR3K8VzpF9+dcYM+A5sQzPqkqbYj/pnGZg== X-Google-Smtp-Source: AGRyM1u27a6LLCUdFJko6UXeDFBM5BXqgpTxDSyczmVj+igLdaSx3S3Mb5URwhYMTRmr6Cgd3jmIJBj/PuRWV1ddR3A= X-Received: by 2002:ac2:47f1:0:b0:479:7517:d41 with SMTP id b17-20020ac247f1000000b0047975170d41mr354755lfp.254.1655314403472; Wed, 15 Jun 2022 10:33:23 -0700 (PDT) Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20220608152757.82529-1-nathan@kernel.org> In-Reply-To: <20220608152757.82529-1-nathan@kernel.org> From: Ulf Hansson Date: Wed, 15 Jun 2022 10:32:46 -0700 Message-ID: Subject: Re: [PATCH] mmc: sdhci-brcmstb: Initialize base_clk to NULL in sdhci_brcmstb_probe() To: Nathan Chancellor Cc: Adrian Hunter , Al Cooper , Kamal Dasu , Florian Fainelli , 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, kernel test robot Content-Type: text/plain; charset="UTF-8" On Wed, 8 Jun 2022 at 08:28, Nathan Chancellor wrote: > > 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 Applied for next, thanks! Kind regards Uffe > --- > drivers/mmc/host/sdhci-brcmstb.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > 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); > > base-commit: 10980053142d8a3e86eb4d3014574424b42b7a45 > -- > 2.36.1 > 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 B4FD9C433EF for ; Wed, 15 Jun 2022 17:34:38 +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:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uImXw1bcrGSQSKpXsrqHKt38YgjSgFgjVvljrGxCcXQ=; b=1+YIF3lOU7Pt+8 2blFVfMeZ/FC7a7IS/aA+bOztbKtDaM0VF0h3fdbXCcPIOV6HKjMmWt9f1DyqkOExfNBbSjSDAWQl xERAYVrPL5u3qplXoy7ZaMwDatq8SbBdvf7I33ATXmlq9b/2yfFNzaggnDD2YyhK9EgmZYz5IQ5+o WQ8ijbToNj1HResy1kqywGdDweNK8f8uo+36qy8PKyfVZISjdWQwrB6e7I/rHmnCnHxnVzPIyzdhS CoImmmOtyhoCdgyr2akmnIeUH4h4Otf1kYCua212LLpJ/ivvXI/B332BGJMH73u5iaRgXaSHxziMR ksSUepUYEB6g7RjEUYWA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1Wta-00FirV-Rd; Wed, 15 Jun 2022 17:33:35 +0000 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1WtT-00FinT-IO for linux-arm-kernel@lists.infradead.org; Wed, 15 Jun 2022 17:33:29 +0000 Received: by mail-lf1-x131.google.com with SMTP id t25so19965477lfg.7 for ; Wed, 15 Jun 2022 10:33:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hd/cGjQ2Xjd6LDpefMqiTBtHv/N383B1PfAFMpFqhy4=; b=ASUCE8+CrV643MgfwX5XdEPd6FlLM4uc/R29PsZSfVTEMoidZJyYKETJnkcSaq/IKA +eA9/hNGuhv7cKf6dfWNuj4XaVHGdkVdkHgMAK3VvbsHc6Ih/EKXWeKHparRqcsI/5tD koAls765sRUN+OJPW9AHvNm29+2wv7BtO0IfMeM/5ontyyEdZFRx49y3t/W4LoS6fLwh ttAr+WadM4xaq8cgT0beYDVpS/PhrA6VwMgdHs/TByUlpS2kAR//ZUAYQs2ndtDDtA9z 3J/rC2KnaSpWtoz+CeJs1NgAKvoITWJyMMcHJNuAU/TOWnZY4AFQoYDw8Llgg3q7LDzw MJpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hd/cGjQ2Xjd6LDpefMqiTBtHv/N383B1PfAFMpFqhy4=; b=R05MUTtoaIP7zNZNap7fO44eBx8M7RaWiLic/6FzHiKjhr6I92PQJftehFtsNOhJqK vcM/YtZRSRHym63rGimEG7gtryUwUW9dIEX+b2ELmz1PrK8mYhVpOFzz2b0zHuSkhvXW MVShQaU0dZGZ/q8tE8JUge429yAzripctIE65wkMB/m177w4QWnWUHk7Ti/RQikXwUIW 9Q5G52h75b4yQjXkKaGIReiz6p0MzJzpLIcDoYZ5xNGi5H9CDJLC4guXuh7PkyH5r12Z 1z4njAFRcteHPeUXisC6Vfz5MDnkJmW2SaU3uSjlybYs3Mda6kH0oO83QvHIVkGtUl2I RZHQ== X-Gm-Message-State: AJIora9U2m2XE7BtTX3zsz6POQTefBPqdapoK+JbidQsbB2/MClXBSro RUqSwXh0QHXqAjEE0YemnGfcjEl19o9bgv5r9XAnGw== X-Google-Smtp-Source: AGRyM1u27a6LLCUdFJko6UXeDFBM5BXqgpTxDSyczmVj+igLdaSx3S3Mb5URwhYMTRmr6Cgd3jmIJBj/PuRWV1ddR3A= X-Received: by 2002:ac2:47f1:0:b0:479:7517:d41 with SMTP id b17-20020ac247f1000000b0047975170d41mr354755lfp.254.1655314403472; Wed, 15 Jun 2022 10:33:23 -0700 (PDT) MIME-Version: 1.0 References: <20220608152757.82529-1-nathan@kernel.org> In-Reply-To: <20220608152757.82529-1-nathan@kernel.org> From: Ulf Hansson Date: Wed, 15 Jun 2022 10:32:46 -0700 Message-ID: Subject: Re: [PATCH] mmc: sdhci-brcmstb: Initialize base_clk to NULL in sdhci_brcmstb_probe() To: Nathan Chancellor Cc: Adrian Hunter , Al Cooper , Kamal Dasu , Florian Fainelli , 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, kernel test robot X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220615_103327_698284_ED2E4B64 X-CRM114-Status: GOOD ( 20.29 ) 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 On Wed, 8 Jun 2022 at 08:28, Nathan Chancellor wrote: > > 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 Applied for next, thanks! Kind regards Uffe > --- > drivers/mmc/host/sdhci-brcmstb.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > 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); > > base-commit: 10980053142d8a3e86eb4d3014574424b42b7a45 > -- > 2.36.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel