From: Zihuan Zhang <zhangzihuan@kylinos.cn>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: "Rafael J . wysocki" <rafael@kernel.org>,
zhenglifeng <zhenglifeng1@huawei.com>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 2/3] cpufreq: sh: drop redundant freq_table argument
Date: Tue, 2 Sep 2025 14:06:39 +0800 [thread overview]
Message-ID: <34092883-c04d-4dbb-a756-eac89fbe6f3e@kylinos.cn> (raw)
In-Reply-To: <20250902054009.rhqu4ki3bl4kr5a7@vireshk-i7>
在 2025/9/2 13:40, Viresh Kumar 写道:
> On 01-09-25, 19:25, Zihuan Zhang wrote:
>> Previously, some cpufreq core helper functions accepted a separate
>> 'freq_table' argument even though the frequency table is now stored
>> inside struct cpufreq_policy.
>>
>> This patch updates all cpufreq core calls to remove the redundant
>> argument and use policy directly.
>>
>> Signed-off-by: Zihuan Zhang <zhangzihuan@kylinos.cn>
>> ---
>> drivers/cpufreq/sh-cpufreq.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/cpufreq/sh-cpufreq.c b/drivers/cpufreq/sh-cpufreq.c
>> index 9c0b01e00508..75d224ba56ba 100644
>> --- a/drivers/cpufreq/sh-cpufreq.c
>> +++ b/drivers/cpufreq/sh-cpufreq.c
>> @@ -93,7 +93,7 @@ static int sh_cpufreq_verify(struct cpufreq_policy_data *policy)
>>
>> freq_table = cpuclk->nr_freqs ? cpuclk->freq_table : NULL;
>> if (freq_table)
> Instead of above, you can now simply check if policy->freq_table is
> valid or not.
I also noticed that in some drivers like acpi-cpufreq.c, if freq_table
allocation fails, the driver won’t be registered at all.
In such cases,
should the NULL check be done inside the core helper functions, or
should it be left to the drivers?
>> - return cpufreq_frequency_table_verify(policy, freq_table);
>> + return cpufreq_frequency_table_verify(policy);
>>
>> cpufreq_verify_within_cpu_limits(policy);
>>
>> --
>> 2.25.1
next prev parent reply other threads:[~2025-09-02 6:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-01 11:25 [PATCH v1 0/3] cpufreq: drop redundant freq_table argument in helpers Zihuan Zhang
2025-09-01 11:25 ` [PATCH v1 1/3] cpufreq: Drop redundant freq_table parameter Zihuan Zhang
2025-09-01 11:25 ` [PATCH v1 2/3] cpufreq: sh: drop redundant freq_table argument Zihuan Zhang
2025-09-02 5:40 ` Viresh Kumar
2025-09-02 6:06 ` Zihuan Zhang [this message]
2025-09-02 6:23 ` Viresh Kumar
2025-09-02 6:43 ` Zihuan Zhang
2025-09-01 11:25 ` [PATCH v1 3/3] cpufreq: virtual: " Zihuan Zhang
2025-09-02 5:42 ` [PATCH v1 0/3] cpufreq: drop redundant freq_table argument in helpers Viresh Kumar
2025-09-02 5:54 ` Zihuan Zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=34092883-c04d-4dbb-a756-eac89fbe6f3e@kylinos.cn \
--to=zhangzihuan@kylinos.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=viresh.kumar@linaro.org \
--cc=zhenglifeng1@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®