lkml.org 
[lkml]   [2019]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V3 3/3] thermal/drivers/cpu_cooling: cpufreq_cooling_register returns an int
On 25-06-19, 13:32, Daniel Lezcano wrote:
> It looks like after the changes in the patch the only reason for

which patch ? Instead of "patch" you should refer to the latest
changes in code, like "now that cpufreq_cooling_unregister() doesn't
accept cdev as an argument ....."

> returning (struct thermal_cooling_device *) from
> cpufreq_cooling_register() is error checking, but it would be much
> more straightforward to return int for this purpose.
>
> Moreover, that would prevent the callers of it from doing incorrect
> things with the returned pointers (like using it to unregister the
> cooling device).
>
> Replace the returned value an integer instead of a pointer to a

as ?

> thermal cooling device structure.
>
> Suggested-by: Rafael J. Wysocki <rafael@kernel.org>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> ---
> drivers/thermal/cpu_cooling.c | 63 +++++++++----------
> drivers/thermal/imx_thermal.c | 6 +-
> .../ti-soc-thermal/ti-thermal-common.c | 7 +--
> include/linux/cpu_cooling.h | 16 ++---
> 4 files changed, 40 insertions(+), 52 deletions(-)

--
viresh

\
 
 \ /
  Last update: 2019-06-26 05:01    [W:0.107 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site