From: Thomas Gleixner <tglx@linutronix.de>
To: Matt Fleming <mattjfleming@googlemail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: ktime_set() does not check for nanoseconds > one second
Date: Mon, 1 Sep 2008 13:20:35 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.1.10.0809011317460.3243@apollo.tec.linutronix.de> (raw)
In-Reply-To: <5ff4a1e50809010338o77fffec4w625ed48b3987d51@mail.gmail.com>
On Mon, 1 Sep 2008, Matt Fleming wrote:
>
> is it intentional that ktime_set() does not check whether the
> nanoseconds argument is greater than the number of nanoseconds in a
> second? I've run into a problem where a value of 1600000000
> nanoseconds was passed as an argument to ktime_set() and the return
> value was then used in a ktime_add() call, which returned an incorrect
> result. Should the caller of ktime_set() make this check or is it
> possible to move this logic in to the function itself?
Yeah, a check for this in ktime_set() might make sense. Currently it's
up to the programmer to provide sane values. :)
Thanks,
tglx
next prev parent reply other threads:[~2008-09-01 11:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-01 10:38 Matt Fleming
2008-09-01 11:20 ` Thomas Gleixner [this message]
2008-09-01 11:57 ` Matt Fleming
2008-09-01 13:06 ` Thomas Gleixner
2008-09-01 13:11 ` Matt Fleming
2008-09-01 13:16 ` Thomas Gleixner
2008-09-01 13:33 ` Matt Fleming
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=alpine.LFD.1.10.0809011317460.3243@apollo.tec.linutronix.de \
--to=tglx@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mattjfleming@googlemail.com \
/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
all inboxes | Powered by JetHome®