[PATCH 07/12] hrtimer: Don't zero-initialize ret in hrtimer_nanosleep()

Thomas Weißschuh (Schneider Electric) posted 12 patches 3 weeks, 6 days ago
[PATCH 07/12] hrtimer: Don't zero-initialize ret in hrtimer_nanosleep()
Posted by Thomas Weißschuh (Schneider Electric) 3 weeks, 6 days ago
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@linutronix.de>
---
 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 b94bd56b739f..226cac8c82cc 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -2328,7 +2328,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);

-- 
2.53.0

[tip: timers/core] hrtimer: Don't zero-initialize ret in hrtimer_nanosleep()
Posted by tip-bot2 for Thomas Weißschuh (Schneider Electric) 3 weeks, 5 days ago
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@linutronix.de>
AuthorDate:    Wed, 11 Mar 2026 11:15:16 +01:00
Committer:     Thomas Gleixner <tglx@kernel.org>
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@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260311-hrtimer-cleanups-v1-7-095357392669@linutronix.de
---
 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);