From: Thomas Gleixner <tglx@linutronix.de>
To: Daniel Church <dchurch@andplus.com>
Cc: linux-kernel@vger.kernel.org, libc-alpha@sourceware.org
Subject: Re: [PATCH 1/2] posix-timers: Prevents overrun counter overflow
Date: Sat, 24 Jan 2015 17:31:29 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.11.1501241729260.5526@nanos> (raw)
In-Reply-To: <1422036211-10934-2-git-send-email-dchurch@andplus.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
next prev parent reply other threads:[~2015-01-24 16:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-23 18:03 [PATCH 0/2] posix-timers: Prevents overrun counter overflow, adds DELAYTIMER_MAX Daniel Church
2015-01-23 18:03 ` [PATCH 1/2] posix-timers: Prevents overrun counter overflow Daniel Church
2015-01-24 16:31 ` Thomas Gleixner [this message]
2015-01-23 18:03 ` [PATCH 2/2] posix-timers: Exposes DELAYTIMER_MAX constant used to govern overruns Daniel Church
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.11.1501241729260.5526@nanos \
--to=tglx@linutronix.de \
--cc=dchurch@andplus.com \
--cc=libc-alpha@sourceware.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®