ptp/kvm, arm_arch_timer: Set system_counterval_t.cs_id to constant
authorPeter Hilber <peter.hilber@opensynergy.com>
Thu, 1 Feb 2024 01:04:50 +0000 (02:04 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 7 Feb 2024 16:05:21 +0000 (17:05 +0100)
commit9be3b2f057d7a6752e8cf25c1d456198b4d3bd6a
tree3fef8a9f80bf6e3499724a78474fe9d43d7e3ca3
parent576bd4962f19bb8f437f8cecbb25e4202438c41e
ptp/kvm, arm_arch_timer: Set system_counterval_t.cs_id to constant

Identify the clocksources used by ptp_kvm by setting the clocksource ID
enum constants. This avoids dereferencing struct clocksource. Once the
system_counterval_t.cs member will be removed, this will also avoid the
need to obtain clocksource pointers from kvm_arch_ptp_get_crosststamp().

The clocksource IDs are associated to timestamps requested from the KVM
hypervisor, so the proper clocksource ID is known at the ptp_kvm request
site.

While at it, also make the ptp_kvm_get_time_fn() 'ret' variable type int as
that's what the function return value is.

Signed-off-by: Peter Hilber <peter.hilber@opensynergy.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20240201010453.2212371-6-peter.hilber@opensynergy.com
drivers/clocksource/arm_arch_timer.c
drivers/ptp/ptp_kvm_arm.c
drivers/ptp/ptp_kvm_common.c
drivers/ptp/ptp_kvm_x86.c
include/linux/ptp_kvm.h