zero-init callback_head by memset(). code is 12 bytes shorter

This commit is contained in:
drochner 2006-06-21 17:16:00 +00:00
parent f7c7c95eb6
commit 9b00231778
1 changed files with 3 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: subr_callback.c,v 1.2 2006/05/27 07:42:42 yamt Exp $ */ /* $NetBSD: subr_callback.c,v 1.3 2006/06/21 17:16:00 drochner Exp $ */
/*- /*-
* Copyright (c)2006 YAMAMOTO Takashi, * Copyright (c)2006 YAMAMOTO Takashi,
@ -27,7 +27,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: subr_callback.c,v 1.2 2006/05/27 07:42:42 yamt Exp $"); __KERNEL_RCSID(0, "$NetBSD: subr_callback.c,v 1.3 2006/06/21 17:16:00 drochner Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -40,12 +40,9 @@ void
callback_head_init(struct callback_head *ch) callback_head_init(struct callback_head *ch)
{ {
memset(ch, 0, sizeof(struct callback_head));
simple_lock_init(&ch->ch_lock); simple_lock_init(&ch->ch_lock);
TAILQ_INIT(&ch->ch_q); TAILQ_INIT(&ch->ch_q);
ch->ch_next = NULL;
ch->ch_nentries = 0;
ch->ch_running = 0;
ch->ch_flags = 0;
} }
void void