lkml.org 
[lkml]   [2015]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] drivers: md: remove duplication with time_after
Date
The logic that was expressed previously was equivalent of calling
time_after.
Remove duplication.

Signed-off-by: Pierre Chevalier <pierrechevalier83@gmail.com>
---
drivers/md/dm-cache-target.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c
index e165053..855e3b3 100644
--- a/drivers/md/dm-cache-target.c
+++ b/drivers/md/dm-cache-target.c
@@ -14,6 +14,7 @@
#include <linux/init.h>
#include <linux/mempool.h>
#include <linux/module.h>
+#include <linux/jiffies.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>

@@ -1562,8 +1563,7 @@ static void process_bio(struct cache *cache, struct prealloc *structs,

static int need_commit_due_to_time(struct cache *cache)
{
- return jiffies < cache->last_commit_jiffies ||
- jiffies > cache->last_commit_jiffies + COMMIT_PERIOD;
+ return time_after(jiffies, cache->last_commit_jiffies + COMMIT_PERIOD);
}

static int commit_if_needed(struct cache *cache)
--
2.2.2


\
 
 \ /
  Last update: 2015-02-05 23:21    [W:0.017 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site