[tip: timers/core] hrtimer: Don't zero-initialize ret in hrtimer_nanosleep()
From: tip-bot2 for Thomas Weißschuh (Schneider Electric)
Date: Thu Mar 12 2026 - 07:33:33 EST
The following commit has been merged into the timers/core branch of tip:
Commit-ID: 194675f16d7307a0109b54cf350ef9f81617f006
Gitweb: https://git.kernel.org/tip/194675f16d7307a0109b54cf350ef9f81617f006
Author: Thomas Weißschuh (Schneider Electric) <thomas.weissschuh@xxxxxxxxxxxxx>
AuthorDate: Wed, 11 Mar 2026 11:15:16 +01:00
Committer: Thomas Gleixner <tglx@xxxxxxxxxx>
CommitterDate: Thu, 12 Mar 2026 12:15:55 +01:00
hrtimer: Don't zero-initialize ret in hrtimer_nanosleep()
The value will be assigned to before any usage.
No other function in hrtimer.c does such a zero-initialization.
Signed-off-by: Thomas Weißschuh (Schneider Electric) <thomas.weissschuh@xxxxxxxxxxxxx>
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxx>
Link: https://patch.msgid.link/20260311-hrtimer-cleanups-v1-7-095357392669@xxxxxxxxxxxxx
---
kernel/time/hrtimer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index cafd677..c7e7d3a 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -2329,7 +2329,7 @@ long hrtimer_nanosleep(ktime_t rqtp, const enum hrtimer_mode mode, const clockid
{
struct restart_block *restart;
struct hrtimer_sleeper t;
- int ret = 0;
+ int ret;
hrtimer_setup_sleeper_on_stack(&t, clockid, mode);
hrtimer_set_expires_range_ns(&t.timer, rqtp, current->timer_slack_ns);