[tip:timers/ptp 5/25] arch/arm64/kvm/hyp_trace.c:121:24: error: incompatible pointer to integer conversion passing 'struct system_time_snapshot *' to parameter of type 'clockid_t' (aka 'int')

From: kernel test robot

Date: Thu Jun 04 2026 - 06:44:31 EST


Hi Thomas,

FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.

tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/ptp
head: 571287cd351fcda7df3050009786f110cfd30bd9
commit: d09439210441efbadd8b0aa32c1ddb1eab2f3abd [5/25] KVM: arm64: Use ktime_get_snapshot_id() to retrieve CLOCK_BOOTTIME
config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20260604/202606041827.OZlaB99X-lkp@xxxxxxxxx/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260604/202606041827.OZlaB99X-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202606041827.OZlaB99X-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

>> arch/arm64/kvm/hyp_trace.c:121:24: error: incompatible pointer to integer conversion passing 'struct system_time_snapshot *' to parameter of type 'clockid_t' (aka 'int') [-Wint-conversion]
121 | ktime_get_snapshot_id(&snap, CLOCK_BOOTTIME);
| ^~~~~
include/linux/timekeeping.h:355:45: note: passing argument to parameter 'clock_id' here
355 | extern void ktime_get_snapshot_id(clockid_t clock_id, struct system_time_snapshot *systime_snapshot);
| ^
>> arch/arm64/kvm/hyp_trace.c:121:31: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'struct system_time_snapshot *' [-Wint-conversion]
121 | ktime_get_snapshot_id(&snap, CLOCK_BOOTTIME);
| ^~~~~~~~~~~~~~
include/uapi/linux/time.h:56:26: note: expanded from macro 'CLOCK_BOOTTIME'
56 | #define CLOCK_BOOTTIME 7
| ^
include/linux/timekeeping.h:355:84: note: passing argument to parameter 'systime_snapshot' here
355 | extern void ktime_get_snapshot_id(clockid_t clock_id, struct system_time_snapshot *systime_snapshot);
| ^
2 errors generated.


vim +121 arch/arm64/kvm/hyp_trace.c

108
109 static void hyp_trace_clock_enable(struct hyp_trace_clock *hyp_clock, bool enable)
110 {
111 struct system_time_snapshot snap;
112
113 if (hyp_clock->running == enable)
114 return;
115
116 if (!enable) {
117 cancel_delayed_work_sync(&hyp_clock->work);
118 hyp_clock->running = false;
119 }
120
> 121 ktime_get_snapshot_id(&snap, CLOCK_BOOTTIME);
122
123 hyp_clock->boot = ktime_to_ns(snap.systime);
124 hyp_clock->cycles = snap.cycles;
125 hyp_clock->mult = 0;
126
127 init_completion(&hyp_clock->ready);
128 INIT_DELAYED_WORK(&hyp_clock->work, __hyp_clock_work);
129 schedule_delayed_work(&hyp_clock->work, msecs_to_jiffies(CLOCK_INIT_MS));
130 wait_for_completion(&hyp_clock->ready);
131 hyp_clock->running = true;
132 }
133

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki