This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/2] posix-timers: Prevents overrun counter overflow
- From: Thomas Gleixner <tglx at linutronix dot de>
- To: Daniel Church <dchurch at andplus dot com>
- Cc: linux-kernel at vger dot kernel dot org, libc-alpha at sourceware dot org
- Date: Sat, 24 Jan 2015 17:31:29 +0100 (CET)
- Subject: Re: [PATCH 1/2] posix-timers: Prevents overrun counter overflow
- Authentication-results: sourceware.org; auth=none
- References: <1422036211-10934-1-git-send-email-dchurch at andplus dot com> <1422036211-10934-2-git-send-email-dchurch at andplus dot com>
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