Re: [PATCH v5 1/4] thermal/netlink: Add the commands and the events for the thresholds

Daniel Lezcano
2024-10-22T07:09:27Z

On 22/10/2024 00:02, Lukasz Luba wrote:
>
>
> On 10/14/24 10:43, Daniel Lezcano wrote:
>> The thresholds exist but there is no notification neither action code
>> related to them yet.
>>
>> These changes implement the netlink for the notifications when the
>> thresholds are crossed, added, deleted or flushed as well as the
>> commands which allows to get the list of the thresholds, flush them,
>> add and delete.
>>
>> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
>> ---

[ ... ]

>> +static inline int thermal_notify_threshold_up(const struct
>> thermal_zone_device *tz)
>> +{
>> +    return 0;
>> +}
>
> These 'return 0' look a bit odd. We usually use 'return -EINVAL' in
> not defined. Although, since we don't check the output of those
> functions  - we are OK. We just have to remember about these zeros,
> one day when we would like to add the check of the return.

The return error really depends on the context of the call site. There
are other subsystems returning 0 when the service is not enabled (eg.
cpufreq.h, devfreq.h, device_cgroup.h, etc ...)

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