ntp: Remove tick_length_base, use tick_length directly

Now that nothing inflates tick_length beyond tick_length_base (the
adjtime path was converted to use time_offset in the previous commit),
the two fields are always equal.

Remove tick_length_base and keep tick_length as the single field.
Remove the per-second reset and the delta update in
ntp_update_frequency() since there is no separate base to track.

No functional change intended.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Assisted-by: Kiro:claude-opus-4.6-1m
Link: https://patch.msgid.link/20260621220051.1030462-8-dwmw2@infradead.org
This commit is contained in:
David Woodhouse
2026-06-21 22:54:00 +01:00
committed by Thomas Gleixner
parent 34ce97c33d
commit 794ddd6e15

View File

@@ -26,8 +26,7 @@
/**
* struct ntp_data - Structure holding all NTP related state
* @tick_usec: USER_HZ period in microseconds
* @tick_length: Adjusted tick length
* @tick_length_base: Base value for @tick_length
* @tick_length: Tick length in ns << NTP_SCALE_SHIFT
* @time_state: State of the clock synchronization
* @time_status: Clock status bits
* @time_offset: Time adjustment in nanoseconds
@@ -68,7 +67,6 @@
struct ntp_data {
unsigned long tick_usec;
u64 tick_length;
u64 tick_length_base;
int time_state;
int time_status;
s64 time_offset;
@@ -260,8 +258,7 @@ static inline void pps_fill_timex(struct ntp_data *ntpdata, struct __kernel_time
#endif /* CONFIG_NTP_PPS */
/*
* Update tick_length and tick_length_base, based on tick_usec, ntp_tick_adj and
* time_freq:
* Update tick_length based on tick_usec, ntp_tick_adj and time_freq:
*/
static void ntp_update_frequency(struct ntp_data *ntpdata)
{
@@ -279,8 +276,7 @@ static void ntp_update_frequency(struct ntp_data *ntpdata)
* Don't wait for the next second_overflow, apply the change to the
* tick length immediately:
*/
ntpdata->tick_length += new_base - ntpdata->tick_length_base;
ntpdata->tick_length_base = new_base;
ntpdata->tick_length = new_base;
}
static inline s64 ntp_update_offset_fll(struct ntp_data *ntpdata, s64 offset64, long secs)
@@ -358,7 +354,6 @@ static void __ntp_clear(struct ntp_data *ntpdata)
ntp_update_frequency(ntpdata);
ntpdata->tick_length = ntpdata->tick_length_base;
ntpdata->time_offset = 0;
ntpdata->skew_delta = 0;
@@ -670,7 +665,6 @@ int second_overflow(unsigned int tkid, time64_t secs)
}
/* Compute the phase adjustment for the next second */
ntpdata->tick_length = ntpdata->tick_length_base;
/* Check PPS signal */
pps_dec_valid(ntpdata);