The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Lukasz Luba <lukasz.luba@arm.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: linux-kernel@vger.kernel.org, daniel.lezcano@linaro.org,
	linux-pm@vger.kernel.org, rui.zhang@intel.com
Subject: Re: [PATCH v2 4/8] thermal: gov_power_allocator: Simplify checks for valid power actor
Date: Wed, 20 Dec 2023 16:22:22 +0000	[thread overview]
Message-ID: <3f83b7a7-b674-486f-889a-033f550f3654@arm.com> (raw)
In-Reply-To: <CAJZ5v0g_+D5WV0kiC_guS4OQP4wb1qgw1xmzFQBhvF9fz4zxJQ@mail.gmail.com>



On 12/20/23 14:40, Rafael J. Wysocki wrote:
> On Tue, Dec 12, 2023 at 2:48 PM Lukasz Luba <lukasz.luba@arm.com> wrote:
>>
>> There is a need to check if the cooling device in the thermal zone
>> supports IPA callback and is set for control trip point.
>> Refactor the code which validates the power actor capabilities and
>> make it more consistent in all places.
> 
> This really is about reducing code duplication which is worth
> mentioning, so I would say
> 
> "Add a helper to check if a given cooling device in a thermal zone
> supports the IPA callback and is bound to the control trip point and
> use it wherever that check is needed to reduce code duplication."
> 

Thanks, I'll use it.

>>
>> No intentional functional impact.
>>
>> Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
>> ---
>>   drivers/thermal/gov_power_allocator.c | 41 +++++++++++----------------
>>   1 file changed, 17 insertions(+), 24 deletions(-)
>>
>> diff --git a/drivers/thermal/gov_power_allocator.c b/drivers/thermal/gov_power_allocator.c
>> index 3328c3ec71f2..1a605fd9c8c6 100644
>> --- a/drivers/thermal/gov_power_allocator.c
>> +++ b/drivers/thermal/gov_power_allocator.c
>> @@ -85,6 +85,13 @@ struct power_allocator_params {
>>          u32 *weighted_req_power;
>>   };
>>
>> +static bool power_actor_is_valid(struct power_allocator_params *params,
>> +                                struct thermal_instance *instance)
>> +{
>> +       return ((instance->trip == params->trip_max) &&
> 
> The inner parens are redundant.

OK

> 
>> +                cdev_is_power_actor(instance->cdev));
>> +}
> 
> The part below LGTM.

  reply	other threads:[~2023-12-20 16:21 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-12 13:48 [PATCH v2 0/8] Add callback for cooling list update to speed-up IPA Lukasz Luba
2023-12-12 13:48 ` [PATCH v2 1/8] thermal: core: Add governor callback for thermal zone change Lukasz Luba
2023-12-20 13:51   ` Rafael J. Wysocki
2023-12-20 16:17     ` Lukasz Luba
2023-12-20 17:44       ` Rafael J. Wysocki
2023-12-20 17:46         ` Lukasz Luba
2023-12-12 13:48 ` [PATCH v2 2/8] thermal: gov_power_allocator: Refactor check_power_actors() Lukasz Luba
2023-12-12 13:48 ` [PATCH v2 3/8] thermal: gov_power_allocator: Move memory allocation out of throttle() Lukasz Luba
2023-12-20 14:35   ` Rafael J. Wysocki
2023-12-20 16:21     ` Lukasz Luba
2023-12-12 13:48 ` [PATCH v2 4/8] thermal: gov_power_allocator: Simplify checks for valid power actor Lukasz Luba
2023-12-20 14:40   ` Rafael J. Wysocki
2023-12-20 16:22     ` Lukasz Luba [this message]
2023-12-12 13:48 ` [PATCH v2 5/8] thermal: gov_power_allocator: Refactor checks in divvy_up_power() Lukasz Luba
2023-12-20 14:41   ` Rafael J. Wysocki
2023-12-12 13:48 ` [PATCH v2 6/8] thermal/sysfs: Update instance->weight under tz lock Lukasz Luba
2023-12-20 14:53   ` Rafael J. Wysocki
2023-12-20 16:23     ` Lukasz Luba
2023-12-12 13:48 ` [PATCH v2 7/8] thermal/sysfs: Update governors when the 'weight' has changed Lukasz Luba
2023-12-20 14:57   ` Rafael J. Wysocki
2023-12-12 13:48 ` [PATCH v2 8/8] thermal: gov_power_allocator: Support new update callback of weights Lukasz Luba
2023-12-20 14:59   ` Rafael J. Wysocki
2023-12-20 16:14     ` Lukasz Luba
2023-12-20 12:54 ` [PATCH v2 0/8] Add callback for cooling list update to speed-up IPA Lukasz Luba
2023-12-20 13:37   ` Rafael J. Wysocki
2023-12-20 16:25     ` Lukasz Luba

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=3f83b7a7-b674-486f-889a-033f550f3654@arm.com \
    --to=lukasz.luba@arm.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.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