From: Joe Perches <joe@perches.com>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: "Manuel Schölling" <manuel.schoelling@gmx.de>,
isdn@linux-pingi.de, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] mISDN: Use time_before()
Date: Wed, 21 May 2014 13:07:46 -0700 [thread overview]
Message-ID: <1400702866.11896.4.camel@joe-AO725> (raw)
In-Reply-To: <537CFE29.7050100@cogentembedded.com>
On Wed, 2014-05-21 at 23:27 +0400, Sergei Shtylyov wrote:
> On 05/21/2014 11:10 PM, Manuel Schölling wrote:
> > To be future-proof and for better readability the time comparisons are modified
> > to use time_before() instead of plain, error-prone math.
> > diff --git a/drivers/isdn/mISDN/l1oip_core.c b/drivers/isdn/mISDN/l1oip_core.c
[]
> > @@ -287,7 +287,7 @@ l1oip_socket_send(struct l1oip *hc, u8 localcodec, u8 channel, u32 chanmask,
> > p = frame;
> >
> > /* restart timer */
> > - if ((int)(hc->keep_tl.expires-jiffies) < 5 * HZ) {
> > + if (time_before(hc->keep_tl.expires - 5 * HZ, jiffies)) {
>
> Wouldn't it be clearer this way:
>
> if (time_before(hc->keep_tl.expires, jiffies + 5 * HZ)) {
> > del_timer(&hc->keep_tl);
> > hc->keep_tl.expires = jiffies + L1OIP_KEEPALIVE * HZ;
> > add_timer(&hc->keep_tl);
mod_timer?
next prev parent reply other threads:[~2014-05-21 20:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-21 19:10 [PATCH 1/2] mISDN: Use time_before() Manuel Schölling
2014-05-21 19:10 ` [PATCH 2/2] mISDN: use mod_timer() Manuel Schölling
2014-05-21 19:27 ` [PATCH 1/2] mISDN: Use time_before() Sergei Shtylyov
2014-05-21 20:07 ` Joe Perches [this message]
2014-05-21 20:43 ` Sergei Shtylyov
2014-05-21 20:08 ` [PATCH v2 " Manuel Schölling
2014-05-21 20:08 ` [PATCH v2 2/2] mISDN: Use mod_timer() Manuel Schölling
2014-05-22 19:50 ` David Miller
2014-05-22 19:50 ` [PATCH v2 1/2] mISDN: Use time_before() David Miller
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=1400702866.11896.4.camel@joe-AO725 \
--to=joe@perches.com \
--cc=isdn@linux-pingi.de \
--cc=linux-kernel@vger.kernel.org \
--cc=manuel.schoelling@gmx.de \
--cc=netdev@vger.kernel.org \
--cc=sergei.shtylyov@cogentembedded.com \
/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