From: Manuel Schölling Date: Thu, 22 May 2014 20:42:37 +0000 (+0200) Subject: dm: use time_in_range() and time_after() X-Git-Tag: omap-for-v4.1/prcm-dts-mfd-syscon-fix~100^2~7 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f30af98cbb111cebd99f09cb7b8cc8c9351c0b3;p=pandora-kernel.git dm: use time_in_range() and time_after() To be future-proof and for better readability the time comparisons are modified to use time_in_range() and time_after() instead of plain, error-prone math. Signed-off-by: Manuel Schölling Signed-off-by: Mike Snitzer --- diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c index 1e96d7889f51..2eca128a9d6a 100644 --- a/drivers/md/dm-cache-target.c +++ b/drivers/md/dm-cache-target.c @@ -11,6 +11,7 @@ #include #include +#include #include #include #include @@ -1547,8 +1548,8 @@ 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_in_range(jiffies, cache->last_commit_jiffies, + cache->last_commit_jiffies + COMMIT_PERIOD); } static int commit_if_needed(struct cache *cache) Reading git-diff-tree failed