Re: [PATCH v2 25/25] timekeeping: Merge timekeeping_update_staged() and timekeeping_update()
From: John Stultz
Date: Thu Oct 24 2024 - 18:41:42 EST
On Wed, Oct 9, 2024 at 1:29 AM Anna-Maria Behnsen
<anna-maria@xxxxxxxxxxxxx> wrote:
>
> From: Anna-Maria Behnsen <anna-maria@xxxxxxxxxxxxx>
>
> timekeeping_update_staged() is the only call site of timekeeping_update().
>
> Merge those functions. No functional change.
>
> Signed-off-by: Anna-Maria Behnsen <anna-maria@xxxxxxxxxxxxx>
> ---
> kernel/time/timekeeping.c | 31 ++++++++++++++-----------------
> 1 file changed, 14 insertions(+), 17 deletions(-)
>
> diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
> index 67d7be2e02fb..d07eb1946ff1 100644
> --- a/kernel/time/timekeeping.c
> +++ b/kernel/time/timekeeping.c
> @@ -529,7 +529,7 @@ EXPORT_SYMBOL_GPL(ktime_get_raw_fast_ns);
> * timekeeping_inject_sleeptime64()
> * __timekeeping_inject_sleeptime(tk, delta);
> * timestamp();
> - * timekeeping_update(tkd, tk, TK_CLEAR_NTP...);
> + * timekeeping_update_staged(tkd, TK_CLEAR_NTP...);
> *
> * (2) On 32-bit systems, the 64-bit boot offset (tk->offs_boot) may be
> * partially updated. Since the tk->offs_boot update is a rare event, this
> @@ -775,10 +775,21 @@ static void timekeeping_restore_shadow(struct tk_data *tkd)
> memcpy(&tkd->shadow_timekeeper, &tkd->timekeeper, sizeof(tkd->timekeeper));
> }
>
> -static void timekeeping_update(struct tk_data *tkd, struct timekeeper *tk, unsigned int action)
> +static void timekeeping_update_staged(struct tk_data *tkd, unsigned int action)
I still think timekeeping_update_from_shadow would be a better name.
> {
> + struct timekeeper *tk = &tk_core.shadow_timekeeper;
> +
Same naming nit, as its easy to mix up what tk is modifying.
Other than those,
Acked-by: John Stultz <jstultz@xxxxxxxxxx>
Thanks so much for these really nice cleanups! They are a great
improvement to the code!
And again, my apologies for jumping off to other things midway through
reviewing these and not getting back to them until now.
thanks
-john