Message ID | 20231117074911.14427-1-adiupina@astralinux.ru |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp364262vqn; Thu, 16 Nov 2023 23:49:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IEVmyPPSSBcrLpXEkZ58kAykM+zuqp+0kci8ftHmvAsj5lSTCZzQqBtFAUNpK/MWfeVw2rd X-Received: by 2002:a17:90b:1e02:b0:280:24a:9141 with SMTP id pg2-20020a17090b1e0200b00280024a9141mr18285783pjb.28.1700207398541; Thu, 16 Nov 2023 23:49:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700207398; cv=none; d=google.com; s=arc-20160816; b=jvF3BGxHXW71WiFrJ6iLOAIHS/wTYhywHm6cgnQfoe79yXC6RyckBgtLQou0Qpn8Bh cB9xPmpsDj6+gIxm4wcMWoz2jPbf3TUlIEuAG9wODmCAu+QPtCg7JiDJwLn85CoCNedK gRSqFadKYLOfy+HaXvhYXtKuiQXV/D+SQ7+pILQiVf7vKg/BioQi4RAFioNesFX6B3Xk 4r2N3lb5JvLSkM1rdYDQKYMNxHZCBHudBF2xNmfPTs1aSlA6bJpkAohaT+Ss4HGVcy3Q H4bdxQ43zPQGZVAFUz6iaLlqKMsZN2pDod34DOaUgfg1C0a54ZOS9J0kNxZD+FgEEn69 J+6w== 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; bh=1VQni7ilcGOXaOAqgJKlmRsQMtXxcIOQI9U7eVJbt7s=; fh=lJV1ZI20ge+MdXnurdWhQ2QBeR6RKHc8EmfUIgocuRE=; b=i7kVzdgJd2XqAWqfwN1uVgYnSZprPPsg2KcQIOnDa2FAUYOQjbO69uAcZdzkZdsz71 P1GJVxLuHbVqXQ0uSAmausPSZU5Wc7WQMQv3r1FJ3T2pepRt675Uz23guvefIxlm61HK hVvoHhBE5GwDh3Jq5IVr7LaqMx3uK18Co++joGaLdZ1uMLjdgxjvhpH0405SgIZyizEF 0MRJa4ghwjjGDID/4VXBmcIlPUi2/GIKJuU5VkVFPCvdxKjl6dh1gdBDht85aUlGXBjS WRNZw+gKleP0HFrj8uoQLHJL5k/oCy20/A2JsYh5hsX4eMJQBDdVdXpKIKWU4kTrpIA6 FC+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id y7-20020a17090a86c700b002800b7caf7dsi1374491pjv.168.2023.11.16.23.49.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 23:49:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 433598250DCD; Thu, 16 Nov 2023 23:49:56 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230384AbjKQHtn (ORCPT <rfc822;jaysivo@gmail.com> + 30 others); Fri, 17 Nov 2023 02:49:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229952AbjKQHtm (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 17 Nov 2023 02:49:42 -0500 Received: from mail.astralinux.ru (mail.astralinux.ru [217.74.38.119]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F314D52; Thu, 16 Nov 2023 23:49:37 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id 9C5A418687BF; Fri, 17 Nov 2023 10:49:33 +0300 (MSK) Received: from mail.astralinux.ru ([127.0.0.1]) by localhost (rbta-msk-vsrv-mail01.astralinux.ru [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id gby14e2W0CAp; Fri, 17 Nov 2023 10:49:33 +0300 (MSK) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id 504581868DBC; Fri, 17 Nov 2023 10:49:33 +0300 (MSK) X-Virus-Scanned: amavisd-new at astralinux.ru Received: from mail.astralinux.ru ([127.0.0.1]) by localhost (rbta-msk-vsrv-mail01.astralinux.ru [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id EVOAij3UbOAZ; Fri, 17 Nov 2023 10:49:33 +0300 (MSK) Received: from rbta-msk-lt-302690.astralinux.ru (unknown [10.177.232.129]) by mail.astralinux.ru (Postfix) with ESMTPSA id 1C00D18687BF; Fri, 17 Nov 2023 10:49:31 +0300 (MSK) From: Alexandra Diupina <adiupina@astralinux.ru> To: Sudeep Holla <sudeep.holla@arm.com> Cc: Alexandra Diupina <adiupina@astralinux.ru>, Cristian Marussi <cristian.marussi@arm.com>, "Rafael J. Wysocki" <rafael@kernel.org>, Viresh Kumar <viresh.kumar@linaro.org>, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: [PATCH] cpufreq: scmi: process the result of devm_of_clk_add_hw_provider() Date: Fri, 17 Nov 2023 10:49:11 +0300 Message-Id: <20231117074911.14427-1-adiupina@astralinux.ru> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 fry.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 16 Nov 2023 23:49:56 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782796673381921423 X-GMAIL-MSGID: 1782796673381921423 |
Series |
cpufreq: scmi: process the result of devm_of_clk_add_hw_provider()
|
|
Commit Message
Alexandra Diupina
Nov. 17, 2023, 7:49 a.m. UTC
devm_of_clk_add_hw_provider() may return an errno, so
add a return value check
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 8410e7f3b31e ("cpufreq: scmi: Fix OPP addition failure with a dummy clock provider")
Signed-off-by: Alexandra Diupina <adiupina@astralinux.ru>
---
drivers/cpufreq/scmi-cpufreq.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
Comments
I'm sorry, I forgot to add "return ret;" after calling the dev_err() function. Before I post the second version of the patch, please let me know what you think about this fix, keeping in mind what I wanted to add "return ret;" 17.11.2023 10:49, Alexandra Diupina пишет: > devm_of_clk_add_hw_provider() may return an errno, so > add a return value check > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Fixes: 8410e7f3b31e ("cpufreq: scmi: Fix OPP addition failure with a dummy clock provider") > Signed-off-by: Alexandra Diupina <adiupina@astralinux.ru> > --- > drivers/cpufreq/scmi-cpufreq.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c > index c8a7ccc42c16..4037945663bf 100644 > --- a/drivers/cpufreq/scmi-cpufreq.c > +++ b/drivers/cpufreq/scmi-cpufreq.c > @@ -334,8 +334,13 @@ static int scmi_cpufreq_probe(struct scmi_device *sdev) > > #ifdef CONFIG_COMMON_CLK > /* dummy clock provider as needed by OPP if clocks property is used */ > - if (of_property_present(dev->of_node, "#clock-cells")) > - devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, NULL); > + if (of_property_present(dev->of_node, "#clock-cells")) { > + ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, NULL); > + if (ret) { > + dev_err(dev, "%s: registering clock provider failed, err: %d\n", > + __func__, ret); > + } > + } > #endif > > ret = cpufreq_register_driver(&scmi_cpufreq_driver); Regards, Alexandra Diupina
Le 17/11/2023 à 12:14, Александра Дюпина a écrit : > I'm sorry, I forgot to add "return ret;" after > calling the dev_err() function. Before I post > the second version of the patch, please let me > know what you think about this fix, keeping in > mind what I wanted to add "return ret;" This is a probe function. So, maybe using dev_err_probe() would be slightly nicer? If yes, the dev_err() that is already there could be updated as well in an other patch. CJ > > 17.11.2023 10:49, Alexandra Diupina пишет: >> devm_of_clk_add_hw_provider() may return an errno, so >> add a return value check >> >> Found by Linux Verification Center (linuxtesting.org) with SVACE. >> >> Fixes: 8410e7f3b31e ("cpufreq: scmi: Fix OPP addition failure with a >> dummy clock provider") >> Signed-off-by: Alexandra Diupina <adiupina@astralinux.ru> >> --- >> drivers/cpufreq/scmi-cpufreq.c | 9 +++++++-- >> 1 file changed, 7 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/cpufreq/scmi-cpufreq.c >> b/drivers/cpufreq/scmi-cpufreq.c >> index c8a7ccc42c16..4037945663bf 100644 >> --- a/drivers/cpufreq/scmi-cpufreq.c >> +++ b/drivers/cpufreq/scmi-cpufreq.c >> @@ -334,8 +334,13 @@ static int scmi_cpufreq_probe(struct scmi_device >> *sdev) >> #ifdef CONFIG_COMMON_CLK >> /* dummy clock provider as needed by OPP if clocks property is >> used */ >> - if (of_property_present(dev->of_node, "#clock-cells")) >> - devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, NULL); >> + if (of_property_present(dev->of_node, "#clock-cells")) { >> + ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, >> NULL); >> + if (ret) { >> + dev_err(dev, "%s: registering clock provider failed, err: >> %d\n", >> + __func__, ret); >> + } >> + } >> #endif >> ret = cpufreq_register_driver(&scmi_cpufreq_driver); > > > Regards, > > Alexandra Diupina >
diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c index c8a7ccc42c16..4037945663bf 100644 --- a/drivers/cpufreq/scmi-cpufreq.c +++ b/drivers/cpufreq/scmi-cpufreq.c @@ -334,8 +334,13 @@ static int scmi_cpufreq_probe(struct scmi_device *sdev) #ifdef CONFIG_COMMON_CLK /* dummy clock provider as needed by OPP if clocks property is used */ - if (of_property_present(dev->of_node, "#clock-cells")) - devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, NULL); + if (of_property_present(dev->of_node, "#clock-cells")) { + ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, NULL); + if (ret) { + dev_err(dev, "%s: registering clock provider failed, err: %d\n", + __func__, ret); + } + } #endif ret = cpufreq_register_driver(&scmi_cpufreq_driver);