[tip: timers/core] timekeeping: Annotate auxiliary clock accessors with __must_check

tip-bot2 for Thomas Weißschuh (Schneider Electric) posted 1 patch 1 month, 2 weeks ago
include/linux/timekeeping.h | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
[tip: timers/core] timekeeping: Annotate auxiliary clock accessors with __must_check
Posted by tip-bot2 for Thomas Weißschuh (Schneider Electric) 1 month, 2 weeks ago
The following commit has been merged into the timers/core branch of tip:

Commit-ID:     2838bdb772e4e94591a90437bf595dba485a3162
Gitweb:        https://git.kernel.org/tip/2838bdb772e4e94591a90437bf595dba485a3162
Author:        Thomas Weißschuh (Schneider Electric) <thomas.weissschuh@linutronix.de>
AuthorDate:    Fri, 31 Jul 2026 16:20:15 +02:00
Committer:     Thomas Gleixner <tglx@kernel.org>
CommitterDate: Tue, 11 Aug 2026 11:12:43 +02:00

timekeeping: Annotate auxiliary clock accessors with __must_check

In contrast to the system time accessors, the ones for auxiliary clocks can
fail.

Make sure the callers check for this.

Signed-off-by: Thomas Weißschuh (Schneider Electric) <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260731-timekeeping-aux-must-check-v1-2-11ae93068497@linutronix.de
---
 include/linux/timekeeping.h | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h
index ca4a881..561313b 100644
--- a/include/linux/timekeeping.h
+++ b/include/linux/timekeeping.h
@@ -267,11 +267,14 @@ extern void timekeeping_inject_sleeptime64(const struct timespec64 *delta);
  * Auxiliary clock interfaces
  */
 #ifdef CONFIG_POSIX_AUX_CLOCKS
-extern bool ktime_get_aux(clockid_t id, ktime_t *kt);
-extern bool ktime_get_aux_ts64(clockid_t id, struct timespec64 *kt);
+extern bool __must_check ktime_get_aux(clockid_t id, ktime_t *kt);
+extern bool __must_check ktime_get_aux_ts64(clockid_t id, struct timespec64 *kt);
 #else
-static inline bool ktime_get_aux(clockid_t id, ktime_t *kt) { return false; }
-static inline bool ktime_get_aux_ts64(clockid_t id, struct timespec64 *kt) { return false; }
+static inline bool __must_check ktime_get_aux(clockid_t id, ktime_t *kt) { return false; }
+static inline bool __must_check ktime_get_aux_ts64(clockid_t id, struct timespec64 *kt)
+{
+	return false;
+}
 #endif
 
 /**