@@ -105,7 +105,7 @@ static inline void tk_normalize_xtime(struct timekeeper *tk)
105105 }
106106}
107107
108- static inline struct timespec64 tk_xtime (struct timekeeper * tk )
108+ static inline struct timespec64 tk_xtime (const struct timekeeper * tk )
109109{
110110 struct timespec64 ts ;
111111
@@ -162,7 +162,7 @@ static inline void tk_update_sleep_time(struct timekeeper *tk, ktime_t delta)
162162 * a read of the fast-timekeeper tkrs (which is protected by its own locking
163163 * and update logic).
164164 */
165- static inline u64 tk_clock_read (struct tk_read_base * tkr )
165+ static inline u64 tk_clock_read (const struct tk_read_base * tkr )
166166{
167167 struct clocksource * clock = READ_ONCE (tkr -> clock );
168168
@@ -211,7 +211,7 @@ static void timekeeping_check_update(struct timekeeper *tk, u64 offset)
211211 }
212212}
213213
214- static inline u64 timekeeping_get_delta (struct tk_read_base * tkr )
214+ static inline u64 timekeeping_get_delta (const struct tk_read_base * tkr )
215215{
216216 struct timekeeper * tk = & tk_core .timekeeper ;
217217 u64 now , last , mask , max , delta ;
@@ -255,7 +255,7 @@ static inline u64 timekeeping_get_delta(struct tk_read_base *tkr)
255255static inline void timekeeping_check_update (struct timekeeper * tk , u64 offset )
256256{
257257}
258- static inline u64 timekeeping_get_delta (struct tk_read_base * tkr )
258+ static inline u64 timekeeping_get_delta (const struct tk_read_base * tkr )
259259{
260260 u64 cycle_now , delta ;
261261
@@ -352,7 +352,7 @@ u32 (*arch_gettimeoffset)(void) = default_arch_gettimeoffset;
352352static inline u32 arch_gettimeoffset (void ) { return 0 ; }
353353#endif
354354
355- static inline u64 timekeeping_delta_to_ns (struct tk_read_base * tkr , u64 delta )
355+ static inline u64 timekeeping_delta_to_ns (const struct tk_read_base * tkr , u64 delta )
356356{
357357 u64 nsec ;
358358
@@ -363,15 +363,15 @@ static inline u64 timekeeping_delta_to_ns(struct tk_read_base *tkr, u64 delta)
363363 return nsec + arch_gettimeoffset ();
364364}
365365
366- static inline u64 timekeeping_get_ns (struct tk_read_base * tkr )
366+ static inline u64 timekeeping_get_ns (const struct tk_read_base * tkr )
367367{
368368 u64 delta ;
369369
370370 delta = timekeeping_get_delta (tkr );
371371 return timekeeping_delta_to_ns (tkr , delta );
372372}
373373
374- static inline u64 timekeeping_cycles_to_ns (struct tk_read_base * tkr , u64 cycles )
374+ static inline u64 timekeeping_cycles_to_ns (const struct tk_read_base * tkr , u64 cycles )
375375{
376376 u64 delta ;
377377
@@ -394,7 +394,8 @@ static inline u64 timekeeping_cycles_to_ns(struct tk_read_base *tkr, u64 cycles)
394394 * slightly wrong timestamp (a few nanoseconds). See
395395 * @ktime_get_mono_fast_ns.
396396 */
397- static void update_fast_timekeeper (struct tk_read_base * tkr , struct tk_fast * tkf )
397+ static void update_fast_timekeeper (const struct tk_read_base * tkr ,
398+ struct tk_fast * tkf )
398399{
399400 struct tk_read_base * base = tkf -> base ;
400401
@@ -549,10 +550,10 @@ EXPORT_SYMBOL_GPL(ktime_get_real_fast_ns);
549550 * number of cycles every time until timekeeping is resumed at which time the
550551 * proper readout base for the fast timekeeper will be restored automatically.
551552 */
552- static void halt_fast_timekeeper (struct timekeeper * tk )
553+ static void halt_fast_timekeeper (const struct timekeeper * tk )
553554{
554555 static struct tk_read_base tkr_dummy ;
555- struct tk_read_base * tkr = & tk -> tkr_mono ;
556+ const struct tk_read_base * tkr = & tk -> tkr_mono ;
556557
557558 memcpy (& tkr_dummy , tkr , sizeof (tkr_dummy ));
558559 cycles_at_suspend = tk_clock_read (tkr );
@@ -1277,7 +1278,7 @@ EXPORT_SYMBOL(do_settimeofday64);
12771278 *
12781279 * Adds or subtracts an offset value from the current time.
12791280 */
1280- static int timekeeping_inject_offset (struct timespec64 * ts )
1281+ static int timekeeping_inject_offset (const struct timespec64 * ts )
12811282{
12821283 struct timekeeper * tk = & tk_core .timekeeper ;
12831284 unsigned long flags ;
@@ -1585,7 +1586,7 @@ static struct timespec64 timekeeping_suspend_time;
15851586 * adds the sleep offset to the timekeeping variables.
15861587 */
15871588static void __timekeeping_inject_sleeptime (struct timekeeper * tk ,
1588- struct timespec64 * delta )
1589+ const struct timespec64 * delta )
15891590{
15901591 if (!timespec64_valid_strict (delta )) {
15911592 printk_deferred (KERN_WARNING
@@ -1646,7 +1647,7 @@ bool timekeeping_rtc_skipsuspend(void)
16461647 * This function should only be called by rtc_resume(), and allows
16471648 * a suspend offset to be injected into the timekeeping values.
16481649 */
1649- void timekeeping_inject_sleeptime64 (struct timespec64 * delta )
1650+ void timekeeping_inject_sleeptime64 (const struct timespec64 * delta )
16501651{
16511652 struct timekeeper * tk = & tk_core .timekeeper ;
16521653 unsigned long flags ;
@@ -2240,7 +2241,7 @@ ktime_t ktime_get_update_offsets_now(unsigned int *cwsseq, ktime_t *offs_real,
22402241/**
22412242 * timekeeping_validate_timex - Ensures the timex is ok for use in do_adjtimex
22422243 */
2243- static int timekeeping_validate_timex (struct timex * txc )
2244+ static int timekeeping_validate_timex (const struct timex * txc )
22442245{
22452246 if (txc -> modes & ADJ_ADJTIME ) {
22462247 /* singleshot must not be used with any other mode bits */
0 commit comments