[PATCH] posix-timers: Drop redundant memset call
From: Cyrill Gorcunov
Date: Sun Mar 16 2025 - 15:58:29 EST
Initially in the commit 6891c4509c79 memset call has been
needed to clear the memory allocated on a stack, then in the
commit 2482097c6c0f memset call occasionally sneaked in regardless
the fact that we're using kmem_cache_zalloc to allocate a new timer,
lets save a few cycles dropping this call.
Signed-off-by: Cyrill Gorcunov <gorcunov@xxxxxxxxx>
---
kernel/time/posix-timers.c | 1 -
1 file changed, 1 deletion(-)
Index: linux-tip.git/kernel/time/posix-timers.c
===================================================================
--- linux-tip.git.orig/kernel/time/posix-timers.c
+++ linux-tip.git/kernel/time/posix-timers.c
@@ -526,7 +526,6 @@ static int do_timer_create(clockid_t whi
} else {
new_timer->it_sigev_notify = SIGEV_SIGNAL;
new_timer->sigq.info.si_signo = SIGALRM;
- memset(&new_timer->sigq.info.si_value, 0, sizeof(sigval_t));
new_timer->sigq.info.si_value.sival_int = new_timer->it_id;
new_timer->it_pid = get_pid(task_tgid(current));
}