kdbus: avoid the use of struct timespec
authorArnd Bergmann <arnd@arndb.de>
Fri, 10 Apr 2015 11:43:37 +0000 (13:43 +0200)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Mon, 4 Apr 2016 01:12:38 +0000 (10:12 +0900)
I did a routine check for new users of 'timespec', which we are trying to remove
from the kernel in order to survive y2038. kdbus came up and looks particularly
trivial to clean up.

This changes the three ktime_get_ts() variants used in kdbus to ktime_get_ns(),
which aside from removing timespec also simplifies the code and makes it
slightly more efficient by avoiding a two-way conversion.

Change-Id: Ia9a2da376609d8e0ec6e311e4c9f27ed3702350e
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
ipc/kdbus/metadata.c
ipc/kdbus/reply.c

index 06e0a54a276a79ca104758e2d3d3321837b796b2..3adc6c2c2e766be8cd25684dfca3394a3e75ea54 100644 (file)
@@ -678,13 +678,8 @@ struct kdbus_meta_conn *kdbus_meta_conn_unref(struct kdbus_meta_conn *mc)
 static void kdbus_meta_conn_collect_timestamp(struct kdbus_meta_conn *mc,
                                              struct kdbus_kmsg *kmsg)
 {
-       struct timespec ts;
-
-       ktime_get_ts(&ts);
-       mc->ts.monotonic_ns = timespec_to_ns(&ts);
-
-       ktime_get_real_ts(&ts);
-       mc->ts.realtime_ns = timespec_to_ns(&ts);
+       mc->ts.monotonic_ns = ktime_get_ns();
+       mc->ts.realtime_ns = ktime_get_real_ns();
 
        if (kmsg)
                mc->ts.seqnum = kmsg->seq;
index 6b3bd81bbb4d99f4c27f8a1ccd686296d906df95..008dca801627edd2351be459cac63ba853d14d86 100644 (file)
@@ -204,11 +204,9 @@ void kdbus_reply_list_scan_work(struct work_struct *work)
                container_of(work, struct kdbus_conn, work.work);
        struct kdbus_reply *reply, *reply_tmp;
        u64 deadline = ~0ULL;
-       struct timespec64 ts;
        u64 now;
 
-       ktime_get_ts64(&ts);
-       now = timespec64_to_ns(&ts);
+       now = ktime_get_ns();
 
        mutex_lock(&conn->lock);
        if (!kdbus_conn_active(conn)) {