Messages in this thread | | | Date | Mon, 1 Sep 2008 13:20:35 +0200 (CEST) | From | Thomas Gleixner <> | Subject | Re: ktime_set() does not check for nanoseconds > one second |
| |
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
| |