From: Lukasz Luba <lukasz.luba@arm.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-kernel@vger.kernel.org, rafael@kernel.org,
linux-pm@vger.kernel.org, Dietmar.Eggemann@arm.com
Subject: Re: [PATCH 1/2] cpufreq: Change macro for store scaling min/max frequency
Date: Mon, 10 Oct 2022 09:49:26 +0100 [thread overview]
Message-ID: <2bc19b09-ea9b-46f6-dd11-27eadb7cd5da@arm.com> (raw)
In-Reply-To: <20221010053614.zu2f3btjlh7woxbj@vireshk-i7>
Hi Viresh,
On 10/10/22 06:36, Viresh Kumar wrote:
> On 30-09-22, 10:48, Lukasz Luba wrote:
>> In order to prepare extension to the store_scaling_max_freq() remove
>> the macro and use two normal functions. The set value for max frequency
>> is important for the task scheduler.
>>
>> Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
>> ---
>> drivers/cpufreq/cpufreq.c | 47 ++++++++++++++++++++++-----------------
>> 1 file changed, 27 insertions(+), 20 deletions(-)
>>
>> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
>> index 69b3d61852ac..1f8b93f42c76 100644
>> --- a/drivers/cpufreq/cpufreq.c
>> +++ b/drivers/cpufreq/cpufreq.c
>> @@ -715,26 +715,33 @@ static ssize_t show_scaling_cur_freq(struct cpufreq_policy *policy, char *buf)
>> return ret;
>> }
>>
>> -/*
>> - * cpufreq_per_cpu_attr_write() / store_##file_name() - sysfs write access
>> - */
>> -#define store_one(file_name, object) \
>> -static ssize_t store_##file_name \
>> -(struct cpufreq_policy *policy, const char *buf, size_t count) \
>> -{ \
>> - unsigned long val; \
>> - int ret; \
>> - \
>> - ret = sscanf(buf, "%lu", &val); \
>> - if (ret != 1) \
>> - return -EINVAL; \
>> - \
>> - ret = freq_qos_update_request(policy->object##_freq_req, val);\
>> - return ret >= 0 ? count : ret; \
>> -}
>> -
>> -store_one(scaling_min_freq, min);
>> -store_one(scaling_max_freq, max);
>> +static ssize_t store_scaling_max_freq
>> +(struct cpufreq_policy *policy, const char *buf, size_t count)
>
> I thought we can't break right after function's name according to
> kernel's coding guidelines. Did you run checkpatch on this ?
The checkpatch didn't capture this, but you are right. I'll change this.
-----------------------------------------------
/tmp/cpufreq//0001-cpufreq-Change-macro-for-store-scaling-min-max-frequ.patch
WARNING: Prefer kstrto<type> to single variable sscanf
#49: FILE: drivers/cpufreq/cpufreq.c:724:
+ ret = sscanf(buf, "%lu", &val);
WARNING: Prefer kstrto<type> to single variable sscanf
#63: FILE: drivers/cpufreq/cpufreq.c:738:
+ ret = sscanf(buf, "%lu", &val);
total: 0 errors, 2 warnings, 53 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or
--fix-inplace.
/tmp/cpufreq//0001-cpufreq-Change-macro-for-store-scaling-min-max-frequ.patch
has style problems, please review.
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
==============================================================
/tmp/cpufreq//0002-cpufreq-Update-CPU-capacity-reduction-in-store_scali.patch
total: 0 errors, 0 warnings, 36 lines checked
/tmp/cpufreq//0002-cpufreq-Update-CPU-capacity-reduction-in-store_scali.patch
has no obvious style problems and is ready for submission.
==============================================================
-----------------------------------------------
prev parent reply other threads:[~2022-10-10 8:49 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-30 9:48 [PATCH 1/2] cpufreq: Change macro for store scaling min/max frequency Lukasz Luba
2022-09-30 9:48 ` [PATCH 2/2] cpufreq: Update CPU capacity reduction in store_scaling_max_freq() Lukasz Luba
2022-10-10 5:39 ` Viresh Kumar
2022-10-10 9:02 ` Lukasz Luba
2022-10-10 9:15 ` Vincent Guittot
2022-10-10 9:30 ` Lukasz Luba
2022-10-10 9:32 ` Vincent Guittot
2022-10-10 10:12 ` Lukasz Luba
2022-10-10 10:22 ` Vincent Guittot
2022-10-10 10:49 ` Lukasz Luba
2022-10-10 12:21 ` Vincent Guittot
2022-10-10 13:05 ` Lukasz Luba
2022-10-10 10:25 ` Peter Zijlstra
2022-10-10 10:46 ` Lukasz Luba
2022-10-11 8:38 ` Peter Zijlstra
2022-10-11 10:25 ` Lukasz Luba
2022-10-10 5:36 ` [PATCH 1/2] cpufreq: Change macro for store scaling min/max frequency Viresh Kumar
2022-10-10 8:49 ` Lukasz Luba [this message]
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=2bc19b09-ea9b-46f6-dd11-27eadb7cd5da@arm.com \
--to=lukasz.luba@arm.com \
--cc=Dietmar.Eggemann@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=viresh.kumar@linaro.org \
/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