[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c01ed2d7-964d-4b75-9a8e-8325d4cc9269@linaro.org>
Date: Wed, 21 Aug 2024 11:32:34 +0200
From: Daniel Lezcano <daniel.lezcano@...aro.org>
To: "Rafael J. Wysocki" <rjw@...ysocki.net>,
Linux PM <linux-pm@...r.kernel.org>
Cc: LKML <linux-kernel@...r.kernel.org>, Lukasz Luba <lukasz.luba@....com>,
Zhang Rui <rui.zhang@...el.com>
Subject: Re: [PATCH v3 03/14] thermal: core: Drop redundant thermal instance
checks
On 19/08/2024 17:52, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
>
> Because the trip and cdev pointers are sufficient to identify a thermal
> instance holding them unambiguously, drop the additional thermal zone
> checks from two loops walking the list of thermal instances in a
> thermal zone.
>
> No intentional functional impact.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
Reviewed-by: Daniel Lezcano <daniel.lezcano@...aro.org>
I'm wondering if the thermal_instance 'tz' field could be removed too ?
> ---
>
> v1 -> v3: No changes
>
> ---
> drivers/thermal/thermal_core.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> Index: linux-pm/drivers/thermal/thermal_core.c
> ===================================================================
> --- linux-pm.orig/drivers/thermal/thermal_core.c
> +++ linux-pm/drivers/thermal/thermal_core.c
> @@ -850,7 +850,7 @@ int thermal_bind_cdev_to_trip(struct the
> mutex_lock(&tz->lock);
> mutex_lock(&cdev->lock);
> list_for_each_entry(pos, &tz->thermal_instances, tz_node)
> - if (pos->tz == tz && pos->trip == trip && pos->cdev == cdev) {
> + if (pos->trip == trip && pos->cdev == cdev) {
> result = -EEXIST;
> break;
> }
> @@ -915,7 +915,7 @@ int thermal_unbind_cdev_from_trip(struct
> mutex_lock(&tz->lock);
> mutex_lock(&cdev->lock);
> list_for_each_entry_safe(pos, next, &tz->thermal_instances, tz_node) {
> - if (pos->tz == tz && pos->trip == trip && pos->cdev == cdev) {
> + if (pos->trip == trip && pos->cdev == cdev) {
> list_del(&pos->tz_node);
> list_del(&pos->cdev_node);
>
>
>
>
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
Powered by blists - more mailing lists