bridgestp: Use static initializers

MFC after:	1 week

(cherry picked from commit fd0020f81a60f7c4a1401de56761cbfb2d745ca7)
This commit is contained in:
Zhenlei Huang 2025-03-06 12:51:44 +08:00
parent dbb5216e03
commit 7fa12e220c

View file

@ -87,7 +87,7 @@
const uint8_t bstp_etheraddr[] = { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 };
LIST_HEAD(, bstp_state) bstp_list;
LIST_HEAD(, bstp_state) bstp_list = LIST_HEAD_INITIALIZER(bstp_list);
static struct mtx bstp_list_mtx;
static void bstp_transmit(struct bstp_state *, struct bstp_port *);
@ -2138,7 +2138,6 @@ bstp_modevent(module_t mod, int type, void *data)
switch (type) {
case MOD_LOAD:
mtx_init(&bstp_list_mtx, "bridgestp list", NULL, MTX_DEF);
LIST_INIT(&bstp_list);
break;
case MOD_UNLOAD:
mtx_destroy(&bstp_list_mtx);