git: c7f8ffc70afa - main - bpf: Use static initializers
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 06 Mar 2025 04:52:36 UTC
The branch main has been updated by zlei:
URL: https://cgit.FreeBSD.org/src/commit/?id=c7f8ffc70afa00ae863fe9f122c5a7eb7b56f4f5
commit c7f8ffc70afa00ae863fe9f122c5a7eb7b56f4f5
Author: Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2025-03-06 04:51:43 +0000
Commit: Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2025-03-06 04:51:43 +0000
bpf: Use static initializers
MFC after: 1 week
---
sys/net/bpf.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index a7e5bda97e23..263f241bcf5f 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -182,7 +182,7 @@ struct bpf_dltlist32 {
* frames, ethernet frames, etc).
*/
CK_LIST_HEAD(bpf_iflist, bpf_if);
-static struct bpf_iflist bpf_iflist;
+static struct bpf_iflist bpf_iflist = CK_LIST_HEAD_INITIALIZER();
static struct sx bpf_sx; /* bpf global lock */
static int bpf_bpfd_cnt;
@@ -3006,8 +3006,6 @@ bpf_drvinit(void *unused)
struct cdev *dev;
sx_init(&bpf_sx, "bpf global lock");
- CK_LIST_INIT(&bpf_iflist);
-
dev = make_dev(&bpf_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "bpf");
/* For compatibility */
make_dev_alias(dev, "bpf0");