linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Emmanuel Nicolet <emmanuel.nicolet@gmail.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>, linux-rtc@vger.kernel.org
Subject: Re: [PATCH] rtc: use timeu64_t for range_max
Date: Thu, 3 Oct 2019 21:55:57 +0200	[thread overview]
Message-ID: <20191003195557.GL575@piout.net> (raw)
In-Reply-To: <20190927110446.GA6289@gmail.com>

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@gmail.com>
> ---
>  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

      reply	other threads:[~2019-10-03 19:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-27 11:04 [PATCH] rtc: use timeu64_t for range_max Emmanuel Nicolet
2019-10-03 19:55 ` Alexandre Belloni [this message]

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=20191003195557.GL575@piout.net \
    --to=alexandre.belloni@bootlin.com \
    --cc=a.zummo@towertech.it \
    --cc=emmanuel.nicolet@gmail.com \
    --cc=linux-rtc@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).