[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <878rrpwsxx.ffs@tglx>
Date: Thu, 28 Apr 2022 09:47:06 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Prakash Sangappa <prakash.sangappa@...cle.com>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"peterz@...radead.org" <peterz@...radead.org>
Subject: Re: [PATCH] ipc: Update semtimedop() to use hrtimer
On Wed, Apr 27 2022 at 23:42, Prakash Sangappa wrote:
>> On Apr 27, 2022, at 3:06 PM, Thomas Gleixner <tglx@...utronix.de> wrote:
>> Converting to ktime first makes this cheaper:
>>
>> expires = ktime_get() + timespec64_to_ns(timeout);
>
> Since user provided timespec is added to current time, shouldn’t it check for overflow?
>
> So, perhaps
>
> expires = ktime_add_safe(ktime_get(), timespec64_to_ns(timeout));
Of course. This was just for illustration and I assumed you figure it
out, which you did. :)
Thanks,
tglx
Powered by blists - more mailing lists