Re: [PATCH] rtc: use timeu64_t for range_max

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 27/09/2019 13:04:46+0200, Emmanuel Nicolet wrote:
> Hi,
> for rtc drivers where rtc->range_max is set U64_MAX, like the PS3 rtc,
> rtc_valid_range() always returns -ERANGE. This is because the local
> variable range_max has type time64_t, so the test
> 	if (time < range_min || time > range_max)
> 		return -ERANGE;
> becomes (time < range_min || time > -1), which always evaluates to true.
> timeu64_t should be used, since it's the type of rtc->range_max.
> 
> Signed-off-by: Emmanuel Nicolet <emmanuel.nicolet@xxxxxxxxx>
> ---
>  drivers/rtc/interface.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
Applied, thanks.

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux