public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Lukasz Luba <lukasz.luba@arm.com>,
	Linux PM <linux-pm@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	Zhang Rui <rui.zhang@intel.com>
Subject: Re: [PATCH v3 1/2] thermal: sysfs: Rework the handling of trip point updates
Date: Mon, 4 Dec 2023 22:44:18 +0100	[thread overview]
Message-ID: <9750e644-8939-4ea2-a2fb-d2c7d7fbb264@linaro.org> (raw)
In-Reply-To: <CAJZ5v0hEo_HPMR=wVsHDTjPrEBLXgBHwom491rEiLJfapg6Rhg@mail.gmail.com>

On 04/12/2023 18:47, Rafael J. Wysocki wrote:

[ ... ]

>>> +static int check_thermal_zone_and_trip_id(struct device *dev,
>>> +                                       struct thermal_zone_device *tz,
>>> +                                       int trip_id)
>>> +{
>>> +     if (!device_is_registered(dev))
>>> +             return -ENODEV;
>>> +
>>> +     if (trip_id < 0 || trip_id >= tz->num_trips)
>>> +             return -EINVAL;
>>
>> I'm not sure if this check is useful. The function is called from
>> trip_point_*_store() which is providing the trip id from the file name
>> parsing which is in turn built from an existing trip id. There is no
>> reason the trip id is going to be wrong.
> 
> I can drop the check just fine.
> 
> Do you have any other comments on this patch?

No, the rest LGTM


-- 
<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


  reply	other threads:[~2023-12-04 21:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-04 14:46 [PATCH v3 0/2] thermal: sysfs: Simplifications of trip point attribute callbacks Rafael J. Wysocki
2023-12-04 14:50 ` [PATCH v3 1/2] thermal: sysfs: Rework the handling of trip point updates Rafael J. Wysocki
2023-12-04 16:55   ` Daniel Lezcano
2023-12-04 17:47     ` Rafael J. Wysocki
2023-12-04 21:44       ` Daniel Lezcano [this message]
2023-12-04 14:52 ` [PATCH v3 2/2] thermal: sysfs: Rework the reading of trip point attributes Rafael J. Wysocki

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=9750e644-8939-4ea2-a2fb-d2c7d7fbb264@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=rafael@kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=rui.zhang@intel.com \
    --cc=srinivas.pandruvada@linux.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