From: Asaf Vertz Date: Tue, 6 Jan 2015 13:44:15 +0000 (+0200) Subject: dm bufio: fix time comparison to use time_after_eq() X-Git-Tag: v4.0-rc1~99^2~6 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f495339c441b9a69c43327f71c23ffa7632e3020;p=karo-tx-linux.git dm bufio: fix time comparison to use time_after_eq() To be future-proof and for better readability the time comparison is modified to use time_after_eq() instead of plain, error-prone math. Signed-off-by: Asaf Vertz Signed-off-by: Mike Snitzer --- diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c index c33b49792b87..86dbbc737402 100644 --- a/drivers/md/dm-bufio.c +++ b/drivers/md/dm-bufio.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -1739,7 +1740,7 @@ static unsigned get_max_age_hz(void) static bool older_than(struct dm_buffer *b, unsigned long age_hz) { - return (jiffies - b->last_accessed) >= age_hz; + return time_after_eq(jiffies, b->last_accessed + age_hz); } static void __evict_old_buffers(struct dm_bufio_client *c, unsigned long age_hz)