lagg: Use static initializers

MFC after:	1 week

(cherry picked from commit 36ebdd0155d07fc53375fb212d9ca80158dde350)
This commit is contained in:
Zhenlei Huang 2025-03-06 12:51:44 +08:00
parent 2ed4c9d94d
commit e461ba1fa3

View file

@ -101,7 +101,8 @@ struct lagg_snd_tag {
struct m_snd_tag *tag;
};
VNET_DEFINE_STATIC(SLIST_HEAD(__trhead, lagg_softc), lagg_list); /* list of laggs */
VNET_DEFINE_STATIC(SLIST_HEAD(__trhead, lagg_softc), lagg_list) =
SLIST_HEAD_INITIALIZER(); /* list of laggs */
#define V_lagg_list VNET(lagg_list)
VNET_DEFINE_STATIC(struct mtx, lagg_list_mtx);
#define V_lagg_list_mtx VNET(lagg_list_mtx)
@ -297,7 +298,6 @@ vnet_lagg_init(const void *unused __unused)
{
LAGG_LIST_LOCK_INIT();
SLIST_INIT(&V_lagg_list);
struct if_clone_addreq req = {
.create_f = lagg_clone_create,
.destroy_f = lagg_clone_destroy,