git: fd0020f81a60 - main - bridgestp: Use static initializers
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 06 Mar 2025 04:52:39 UTC
The branch main has been updated by zlei:
URL: https://cgit.FreeBSD.org/src/commit/?id=fd0020f81a60f7c4a1401de56761cbfb2d745ca7
commit fd0020f81a60f7c4a1401de56761cbfb2d745ca7
Author: Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2025-03-06 04:51:44 +0000
Commit: Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2025-03-06 04:51:44 +0000
bridgestp: Use static initializers
MFC after: 1 week
---
sys/net/bridgestp.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c
index cdaf6b415417..c67f1efe3d88 100644
--- a/sys/net/bridgestp.c
+++ b/sys/net/bridgestp.c
@@ -86,7 +86,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 *);
@@ -2137,7 +2137,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);