The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] posix-timers: Drop redundant memset call
@ 2025-03-16 19:58 Cyrill Gorcunov
  2025-03-17  9:45 ` [tip: timers/core] posix-timers: Drop redundant memset() invocation tip-bot2 for Cyrill Gorcunov
  0 siblings, 1 reply; 2+ messages in thread
From: Cyrill Gorcunov @ 2025-03-16 19:58 UTC (permalink / raw)
  To: LKML; +Cc: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner

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@gmail.com>
---
 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));
 	}

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-03-17  9:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-16 19:58 [PATCH] posix-timers: Drop redundant memset call Cyrill Gorcunov
2025-03-17  9:45 ` [tip: timers/core] posix-timers: Drop redundant memset() invocation tip-bot2 for Cyrill Gorcunov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox