From 19b6924cdc82d82d373b8cc0eaa03f9ff785e43d Mon Sep 17 00:00:00 2001 From: Zhenlei Huang Date: Thu, 6 Mar 2025 12:51:43 +0800 Subject: [PATCH] bpf: Use static initializers MFC after: 1 week (cherry picked from commit c7f8ffc70afa00ae863fe9f122c5a7eb7b56f4f5) --- 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 e8c9aa7ce4f..de56f3db782 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -184,7 +184,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; @@ -3008,8 +3008,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");