staging: lustre: Use time_before()
authorManuel Schölling <manuel.schoelling@gmx.de>
Wed, 21 May 2014 17:16:36 +0000 (19:16 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 May 2014 12:06:30 +0000 (21:06 +0900)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/include/linux/obd.h

index fea7e6cd44c303fe001ba53b702cbde6b4f0b717..f96f65d5168fbd480fa5abdd0b056c1149caafd6 100644 (file)
@@ -80,8 +80,8 @@ static inline void __client_obd_list_lock(client_obd_lock_t *lock,
                        break;
                }
 
-               if ((jiffies - cur > 5 * HZ) &&
-                   (jiffies - lock->time > 5 * HZ)) {
+               if (time_before(cur + 5 * HZ, jiffies) &&
+                   time_before(lock->time + 5 * HZ, jiffies)) {
                        struct task_struct *task = lock->task;
 
                        if (task == NULL)