[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.11.1501241729260.5526@nanos>
Date: Sat, 24 Jan 2015 17:31:29 +0100 (CET)
From: Thomas Gleixner <tglx@...utronix.de>
To: Daniel Church <dchurch@...plus.com>
cc: linux-kernel@...r.kernel.org, libc-alpha@...rceware.org
Subject: Re: [PATCH 1/2] posix-timers: Prevents overrun counter overflow
On Fri, 23 Jan 2015, Daniel Church wrote:
> + overruns = (unsigned int) hrtimer_forward(timer,
> + timer->base->get_time(),
> + timr->it.real.interval);
> + if (overruns >= delaytimer_max ||
> + (timr->it_overrun >= 0 &&
> + timr->it_overrun >= delaytimer_max - overruns)) {
> + timr->it_overrun = delaytimer_max;
> + } else {
> + timr->it_overrun += overruns;
> + }
We certainly do not add the same logic 3 times via copy and
paste. Please make that a proper helper function.
Thanks,
tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists