connection: use nsecs_to_jiffies()
authorDaniel Mack <daniel@zonque.org>
Mon, 29 Sep 2014 19:42:58 +0000 (21:42 +0200)
committerDaniel Mack <daniel@zonque.org>
Mon, 29 Sep 2014 19:42:58 +0000 (21:42 +0200)
Use nsecs_to_jiffies() to calculate the number of jiffies for the next
timeout instead of dancing around with div_u64().

Signed-off-by: Daniel Mack <daniel@zonque.org>
connection.c

index e74d42ed42fb2c439203e79a9d83bfd2c709035d..b7af840727968e677fbc763667a0870b191eba43 100644 (file)
@@ -195,11 +195,10 @@ static void kdbus_conn_work(struct work_struct *work)
        }
 
        /* rearm delayed work with next timeout */
-       if (deadline != ~0ULL) {
-               u64 usecs = div_u64(deadline - now, 1000ULL);
+       if (deadline != ~0ULL)
+               schedule_delayed_work(&conn->work,
+                                     nsecs_to_jiffies(deadline - now));
 
-               schedule_delayed_work(&conn->work, usecs_to_jiffies(usecs));
-       }
        mutex_unlock(&conn->lock);
 
        kdbus_notify_flush(conn->bus);