From: "Thomas Weißschuh (Schneider Electric)" <thomas.weissschuh@linutronix.de>
To: John Stultz <jstultz@google.com>,
Thomas Gleixner <tglx@kernel.org>,
Stephen Boyd <sboyd@kernel.org>,
Miroslav Lichvar <mlichvar@redhat.com>
Cc: linux-kernel@vger.kernel.org,
"Thomas Weißschuh (Schneider Electric)"
<thomas.weissschuh@linutronix.de>
Subject: [PATCH v3 3/4] timekeeping: Remove the unnecessary tk_is_aux()
Date: Mon, 30 Nov 2026 17:50:02 +0100 [thread overview]
Message-ID: <20261130-timekeeping-conditionals-v3-3-3f95edbfec4d@linutronix.de> (raw)
In-Reply-To: <20261130-timekeeping-conditionals-v3-0-3f95edbfec4d@linutronix.de>
Any timekeeper which is not the core timekeeper is already known to be
an auxiliary one. There is no need for an additional conditional.
Remove the 'else if' and the now unused tk_is_aux().
Signed-off-by: Thomas Weißschuh (Schneider Electric) <thomas.weissschuh@linutronix.de>
---
kernel/time/timekeeping.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 9d304a998758..601f21865622 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -66,10 +66,6 @@ static inline bool tk_get_aux_ts64(unsigned int tkid, struct timespec64 *ts)
return ktime_get_aux_ts64(CLOCK_AUX + tkid - TIMEKEEPER_AUX_FIRST, ts);
}
-static inline bool tk_is_aux(const struct timekeeper *tk)
-{
- return tk->id >= TIMEKEEPER_AUX_FIRST && tk->id <= TIMEKEEPER_AUX_LAST;
-}
static inline struct tk_data *aux_get_tk_data(clockid_t id);
#else
static inline bool tk_get_aux_ts64(unsigned int tkid, struct timespec64 *ts)
@@ -77,10 +73,6 @@ static inline bool tk_get_aux_ts64(unsigned int tkid, struct timespec64 *ts)
return false;
}
-static inline bool tk_is_aux(const struct timekeeper *tk)
-{
- return false;
-}
static inline struct tk_data *aux_get_tk_data(clockid_t id)
{
return NULL;
@@ -852,7 +844,7 @@ static void timekeeping_update_from_shadow(struct tk_data *tkd, unsigned int act
update_fast_timekeeper(&tk->tkr_mono, &tk_fast_mono);
update_fast_timekeeper(&tk->tkr_raw, &tk_fast_raw);
- } else if (tk_is_aux(tk)) {
+ } else {
vdso_time_update_aux(tk);
}
--
2.56.1
next prev parent reply other threads:[~2026-11-30 16:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 16:49 [PATCH v3 0/4] timekeeping: Avoid some runtime conditionals around auxiliary clocks Thomas Weißschuh (Schneider Electric)
2026-11-30 16:50 ` [PATCH v3 1/4] timekeeping: Move timekeeper_is_core_tk() up in the file Thomas Weißschuh (Schneider Electric)
2026-11-30 16:50 ` [PATCH v3 2/4] timekeeping: Use timekeeper_is_core_tk() in timekeeping_update_on_shadow() Thomas Weißschuh (Schneider Electric)
2026-11-30 16:50 ` Thomas Weißschuh (Schneider Electric) [this message]
2026-11-30 16:50 ` [PATCH v3 4/4] timekeeping: Introduce and use timekeeper_is_clock_valid() Thomas Weißschuh (Schneider Electric)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261130-timekeeping-conditionals-v3-3-3f95edbfec4d@linutronix.de \
--to=thomas.weissschuh@linutronix.de \
--cc=jstultz@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mlichvar@redhat.com \
--cc=sboyd@kernel.org \
--cc=tglx@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®