]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
pps: generators: Use ktime_get_real_ts64() instead of ktime_get_snapshot()
authorThomas Gleixner <tglx@kernel.org>
Fri, 29 May 2026 19:59:59 +0000 (21:59 +0200)
committerThomas Gleixner <tglx@kernel.org>
Tue, 2 Jun 2026 09:39:58 +0000 (11:39 +0200)
There is no reason to use the more complex ktime_get_snapshot() for
retrieving CLOCK_REALTIME.

Just use ktime_get_real_ts64(), which avoids the extra timespec64
conversion as a bonus.

No functional change intended.

Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Tested-by: Arthur Kiyanovski <akiyano@amazon.com>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Acked-by: Rodolfo Giometti <giometti@enneenne.com>
Link: https://patch.msgid.link/20260529195557.074439049@kernel.org
drivers/pps/generators/pps_gen-dummy.c
drivers/pps/generators/pps_gen_tio.c

index 547fa7fe29f4db3041391d640bf4a7dc9725cbcd..a4395543c4bb689af4f6a414fc04bf3e389a682a 100644 (file)
@@ -39,11 +39,7 @@ static void pps_gen_ktimer_event(struct timer_list *unused)
 static int pps_gen_dummy_get_time(struct pps_gen_device *pps_gen,
                                        struct timespec64 *time)
 {
-       struct system_time_snapshot snap;
-
-       ktime_get_snapshot(&snap);
-       *time = ktime_to_timespec64(snap.real);
-
+       ktime_get_real_ts64(time);
        return 0;
 }
 
index de00a85bfafa2dd2dd822bf7dac20f67ddd42300..9483d126ada015bb739830d3b46214e79c13d0e4 100644 (file)
@@ -189,11 +189,7 @@ static int pps_tio_gen_enable(struct pps_gen_device *pps_gen, bool enable)
 static int pps_tio_get_time(struct pps_gen_device *pps_gen,
                            struct timespec64 *time)
 {
-       struct system_time_snapshot snap;
-
-       ktime_get_snapshot(&snap);
-       *time = ktime_to_timespec64(snap.real);
-
+       ktime_get_real_ts64(time);
        return 0;
 }