git: b755058a24c3 - stable/14 - vnet: Use static initializers
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 13 Mar 2025 10:14:32 UTC
The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=b755058a24c3ebda4c26ec21575d7757f4a7f65b commit b755058a24c3ebda4c26ec21575d7757f4a7f65b Author: Zhenlei Huang <zlei@FreeBSD.org> AuthorDate: 2025-03-06 04:51:45 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2025-03-13 10:13:51 +0000 vnet: Use static initializers MFC after: 1 week (cherry picked from commit 23f453ae34c29b99f892da18db44ce4292ccb7c3) --- sys/net/vnet.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/net/vnet.c b/sys/net/vnet.c index 688a8eb24591..13eb85266ff6 100644 --- a/sys/net/vnet.c +++ b/sys/net/vnet.c @@ -101,7 +101,7 @@ struct sx vnet_sxlock; sx_xunlock(&vnet_sxlock); \ } while (0) -struct vnet_list_head vnet_head; +struct vnet_list_head vnet_head = LIST_HEAD_INITIALIZER(vnet_head); struct vnet *vnet0; /* @@ -313,7 +313,6 @@ vnet_init_prelink(void *arg __unused) rw_init(&vnet_rwlock, "vnet_rwlock"); sx_init(&vnet_sxlock, "vnet_sxlock"); sx_init(&vnet_sysinit_sxlock, "vnet_sysinit_sxlock"); - LIST_INIT(&vnet_head); } SYSINIT(vnet_init_prelink, SI_SUB_VNET_PRELINK, SI_ORDER_FIRST, vnet_init_prelink, NULL);