mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ioat: Use time_before()
@ 2014-05-22 20:11 Manuel Schölling
  2014-08-21 17:10 ` Dan Williams
  0 siblings, 1 reply; 4+ messages in thread
From: Manuel Schölling @ 2014-05-22 20:11 UTC (permalink / raw)
  To: vinod.koul
  Cc: dan.j.williams, b.zolnierkie, dmaengine, linux-kernel,
	kernel-janitors, Manuel Schölling

To be future-proof and for better readability the time comparisons are modified
to use time_before() instead of plain, error-prone math.

Signed-off-by: Manuel Schölling <manuel.schoelling@gmx.de>
---
 drivers/dma/ioat/dma_v2.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/ioat/dma_v2.c b/drivers/dma/ioat/dma_v2.c
index 8d10580..fdd60c7 100644
--- 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;
 
 		mod_timer(&chan->timer, jiffies + COMPLETION_TIMEOUT);
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-08-22 16:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-22 20:11 [PATCH] ioat: Use time_before() Manuel Schölling
2014-08-21 17:10 ` Dan Williams
2014-08-21 17:44   ` Joe Perches
2014-08-22 16:52     ` Julia Lawall

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®