[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1634aafd2a99cedceb63efe57e4c7e0a7317917b.camel@codethink.co.uk>
Date: Thu, 21 Nov 2019 16:52:26 +0000
From: Ben Hutchings <ben.hutchings@...ethink.co.uk>
To: Arnd Bergmann <arnd@...db.de>, y2038@...ts.linaro.org,
Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>
Cc: Kees Cook <keescook@...omium.org>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Frederic Weisbecker <frederic@...nel.org>,
linux-kernel@...r.kernel.org,
Anna-Maria Gleixner <anna-maria@...utronix.de>
Subject: Re: [Y2038] [PATCH 21/23] y2038: itimer: change implementation to
timespec64
On Fri, 2019-11-08 at 22:12 +0100, Arnd Bergmann wrote:
[...]
> @@ -292,8 +296,8 @@ static unsigned int alarm_setitimer(unsigned int seconds)
> * We can't return 0 if we have an alarm pending ... And we'd
> * better return too much than too little anyway
> */
> - if ((!it_old.it_value.tv_sec && it_old.it_value.tv_usec) ||
> - it_old.it_value.tv_usec >= 500000)
> + if ((!it_old.it_value.tv_sec && it_old.it_value.tv_nsec) ||
> + it_old.it_value.tv_nsec >= 500000)
[...]
This is now off by a factor of 1000. It might be helpful to use
NSEC_PER_SEC / 2 here so no-one has to count the 0 digits.
Ben.
--
Ben Hutchings, Software Developer Codethink Ltd
https://www.codethink.co.uk/ Dale House, 35 Dale Street
Manchester, M1 2HF, United Kingdom
Powered by blists - more mailing lists