git: 3f1570847831 - main - itimers_alloc: no need to initialize its_timers array

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Tue, 28 Dec 2021 01:07:35 UTC
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=3f1570847831e6dbcafc1f416f96404bf66048f2

commit 3f1570847831e6dbcafc1f416f96404bf66048f2
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-12-27 18:32:01 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-12-28 01:02:53 +0000

    itimers_alloc: no need to initialize its_timers array
    
    struct itimers is allocated with M_ZERO, setting all members to NULL
    is tautological.
    
    Reviewed by:    imp, markj, mav
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D33670
---
 sys/kern/kern_time.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c
index a52dc83e9b4c..4c53b728a500 100644
--- a/sys/kern/kern_time.c
+++ b/sys/kern/kern_time.c
@@ -1785,14 +1785,11 @@ static void
 itimers_alloc(struct proc *p)
 {
 	struct itimers *its;
-	int i;
 
 	its = malloc(sizeof (struct itimers), M_SUBPROC, M_WAITOK | M_ZERO);
 	LIST_INIT(&its->its_virtual);
 	LIST_INIT(&its->its_prof);
 	TAILQ_INIT(&its->its_worklist);
-	for (i = 0; i < TIMER_MAX; i++)
-		its->its_timers[i] = NULL;
 	PROC_LOCK(p);
 	if (p->p_itimers == NULL) {
 		p->p_itimers = its;