Re: [PATCH] sched/uclamp: Fix overzealous type replacement

From: Qais Yousef
Date: Thu Nov 14 2019 - 15:29:03 EST


On 11/13/19 16:53, Valentin Schneider wrote:
> Some uclamp helpers had their return type changed from 'unsigned int' to
> 'enum uclamp_id' by commit
>
> 0413d7f33e60 ("sched/uclamp: Always use 'enum uclamp_id' for clamp_id values")
>
> but it happens that some *actually* do return an unsigned int value. Those
> are the helpers that return a utilization value: uclamp_rq_max_value() and
> uclamp_eff_value(). Fix those up.
>
> Note that this doesn't lead to any obj diff using a relatively recent
> aarch64 compiler (8.3-2019.03). The current code of e.g. uclamp_eff_value()
> already figures out that the return value is 11 bits (bits_per(1024)) and
> doesn't seem to do anything funny. I'm still marking this as fixing the
> above commit to be on the safe side.
>
> Fixes: 0413d7f33e60 ("sched/uclamp: Always use 'enum uclamp_id' for clamp_id values")
> Signed-off-by: Valentin Schneider <valentin.schneider@xxxxxxx>
> ---

The changelog could be a bit simpler and more explicitly say 0413d7f33e60
wrongly changed the return type of some functions. For a second I thought
something weird is going inside these functions.

But that could be just me :-)

Reviewed-by: Qais Yousef <qais.yousef@xxxxxxx>

Thanks!

--
Qais Yousef