[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+5LGR2dEk2cGm0maSUWVG2x-t33TWvd8=2UVqmmN+BWwB=CgQ@mail.gmail.com>
Date: Sun, 8 Nov 2020 11:27:26 +0200
From: Ilia Lin <ilia.lin@...il.com>
To: Viresh Kumar <viresh.kumar@...aro.org>
Cc: Ilia Lin <ilia.lin@...nel.org>, Andy Gross <agross@...nel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
"open list:QUALCOMM CPUFREQ DRIVER MSM8996/APQ8096"
<linux-pm@...r.kernel.org>,
Vincent Guittot <vincent.guittot@...aro.org>,
Stephen Boyd <sboyd@...nel.org>, Nishanth Menon <nm@...com>,
digetx@...il.com,
"open list:ARM/QUALCOMM SUPPORT" <linux-arm-msm@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 3/7] cpufreq: qcom-cpufreq-nvmem: dev_pm_opp_put_*()
accepts NULL argument
Reviewed-by: Ilia Lin <ilia.lin@...nel.org>
On Fri, Nov 6, 2020 at 9:05 AM Viresh Kumar <viresh.kumar@...aro.org> wrote:
>
> The dev_pm_opp_put_*() APIs now accepts a NULL opp_table pointer and so
> there is no need for us to carry the extra checks. Drop them.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@...aro.org>
> ---
> drivers/cpufreq/qcom-cpufreq-nvmem.c | 15 ++++++---------
> 1 file changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/cpufreq/qcom-cpufreq-nvmem.c b/drivers/cpufreq/qcom-cpufreq-nvmem.c
> index d06b37822c3d..747d602f221e 100644
> --- a/drivers/cpufreq/qcom-cpufreq-nvmem.c
> +++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c
> @@ -397,19 +397,19 @@ static int qcom_cpufreq_probe(struct platform_device *pdev)
>
> free_genpd_opp:
> for_each_possible_cpu(cpu) {
> - if (IS_ERR_OR_NULL(drv->genpd_opp_tables[cpu]))
> + if (IS_ERR(drv->genpd_opp_tables[cpu]))
> break;
> dev_pm_opp_detach_genpd(drv->genpd_opp_tables[cpu]);
> }
> kfree(drv->genpd_opp_tables);
> free_opp:
> for_each_possible_cpu(cpu) {
> - if (IS_ERR_OR_NULL(drv->names_opp_tables[cpu]))
> + if (IS_ERR(drv->names_opp_tables[cpu]))
> break;
> dev_pm_opp_put_prop_name(drv->names_opp_tables[cpu]);
> }
> for_each_possible_cpu(cpu) {
> - if (IS_ERR_OR_NULL(drv->hw_opp_tables[cpu]))
> + if (IS_ERR(drv->hw_opp_tables[cpu]))
> break;
> dev_pm_opp_put_supported_hw(drv->hw_opp_tables[cpu]);
> }
> @@ -430,12 +430,9 @@ static int qcom_cpufreq_remove(struct platform_device *pdev)
> platform_device_unregister(cpufreq_dt_pdev);
>
> for_each_possible_cpu(cpu) {
> - if (drv->names_opp_tables[cpu])
> - dev_pm_opp_put_supported_hw(drv->names_opp_tables[cpu]);
> - if (drv->hw_opp_tables[cpu])
> - dev_pm_opp_put_supported_hw(drv->hw_opp_tables[cpu]);
> - if (drv->genpd_opp_tables[cpu])
> - dev_pm_opp_detach_genpd(drv->genpd_opp_tables[cpu]);
> + dev_pm_opp_put_supported_hw(drv->names_opp_tables[cpu]);
> + dev_pm_opp_put_supported_hw(drv->hw_opp_tables[cpu]);
> + dev_pm_opp_detach_genpd(drv->genpd_opp_tables[cpu]);
> }
>
> kfree(drv->names_opp_tables);
> --
> 2.25.0.rc1.19.g042ed3e048af
>
Powered by blists - more mailing lists