bpf: Use static initializers

MFC after:	1 week

(cherry picked from commit c7f8ffc70afa00ae863fe9f122c5a7eb7b56f4f5)
This commit is contained in:
Zhenlei Huang 2025-03-06 12:51:43 +08:00 committed by Franco Fichtner
parent 9e57b6b4f5
commit 19b6924cdc

View File

@ -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");