mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Dan Williams <dan.j.williams@intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Dave Young <hidave.darkstar@gmail.com>
Cc: "Manuel Schölling" <manuel.schoelling@gmx.de>,
	"Vinod Koul" <vinod.koul@intel.com>,
	"Bartlomiej Zolnierkiewicz" <b.zolnierkie@samsung.com>,
	"dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] ioat: Use time_before()
Date: Thu, 21 Aug 2014 10:44:44 -0700	[thread overview]
Message-ID: <1408643084.23250.84.camel@joe-AO725> (raw)
In-Reply-To: <CAPcyv4gnMVHd6R=WuN84TLxrAgsBAq8u9_PcmpgD8QECZMZAQw@mail.gmail.com>

On Thu, 2014-08-21 at 10:10 -0700, Dan Williams wrote:
> On Thu, May 22, 2014 at 1:11 PM, Manuel Schölling
> <manuel.schoelling@gmx.de> 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/dma/ioat/dma_v2.c b/drivers/dma/ioat/dma_v2.c
[]
> > @@ -735,7 +735,8 @@ int ioat2_check_space_lock(struct ioat2_dma_chan *ioat, int num_descs)
> >          * called under bh_disabled so we need to trigger the timer
> >          * event directly
> >          */
> > -       if (jiffies > chan->timer.expires && timer_pending(&chan->timer)) {
> > +       if (time_before(chan->timer.expires, jiffies)
> > +           && timer_pending(&chan->timer)) {
> >                 struct ioatdma_device *device = chan->device;
> 
> Thanks, let's use time_is_before_jiffies() for this cleanup... I'll
> fix up and apply.

There are thousands of uses of time_before( and time_after(
with jiffies, and 6 years after being added, a little more
than a dozen or so of time_is_[before|after]_jiffies.

I also think the "time_is_[before|after]_jiffies" macros are
not very well named.

Using them is more text than using jiffies directly.
There is a small benefit in argument ordering correctness.

	time_after(jiffies, foo)
	time_is_after_jiffies(foo)

I'd rather just drop jiffies altogether
	time_is_after(foo)
or maybe add and use
	jiffies_is_after(foo)

(all the other after_eq/before/before_eq variants too).


  reply	other threads:[~2014-08-21 17:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-22 20:11 Manuel Schölling
2014-08-21 17:10 ` Dan Williams
2014-08-21 17:44   ` Joe Perches [this message]
2014-08-22 16:52     ` Julia Lawall

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=1408643084.23250.84.camel@joe-AO725 \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=b.zolnierkie@samsung.com \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=hidave.darkstar@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manuel.schoelling@gmx.de \
    --cc=vinod.koul@intel.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

all inboxes | Powered by JetHome®