Skip to contentSkip to conversation

drivers: md: remove duplication with time_after

PATCH New Pierre Chevalier 1 participant 1 message Feb 5, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: md: remove duplication with time_after

The logic that was expressed previously was equivalent of calling time_after.
Remove duplication.

---
 drivers/md/dm-cache-target.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/md/dm-cache-target.c +2 -2
index e165053..855e3b3 100644
@@ -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)
Signature · 1 line
2.2.2