ptp: Use ktime_get_clock_ts64() for timestamping
authorThomas Gleixner <tglx@linutronix.de>
Tue, 1 Jul 2025 13:27:00 +0000 (15:27 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 3 Jul 2025 13:36:04 +0000 (15:36 +0200)
commit4c09a4cebd0320c5381afad3fb6f997f20082a3b
tree28c2a5d232fedf65efc35515e4fbcfb1138e6d67
parent4f38a6db7bcfc4502c08f4095d2abf686828cff9
ptp: Use ktime_get_clock_ts64() for timestamping

The inlined ptp_read_system_[pre|post]ts() switch cases expand to a copious
amount of text in drivers, e.g. ~500 bytes in e1000e. Adding auxiliary
clock support to the inlines would increase it further.

Replace the inline switch case with a call to ktime_get_clock_ts64(), which
reduces the code size in drivers and allows to access auxiliary clocks once
they are enabled in the IOCTL parameter filter.

No functional change.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Acked-by: John Stultz <jstultz@google.com>
Link: https://patch.msgid.link/20250701132628.426168092@linutronix.de
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
include/linux/ptp_clock_kernel.h