From nobody Thu Mar 13 10:14:29 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ZD3JQ04Dtz5qQsQ; Thu, 13 Mar 2025 10:14:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZD3JP2PjCz3ljm; Thu, 13 Mar 2025 10:14:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741860869; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XWCHRJ1JliREv3kBYdsB6MeCs2G/ON0JyM3mxo9nt34=; b=KL9pC2JzQtrpBJbz0Usuvga+4mE2iEvTgJoLt5/TKjLswDXu4Qxy1PXB31vPcnUWsqLGJ1 xhXH16NXaZTOyVA2RpFUhrkKiYM8AbNVCvMgluc/HPwHFS2VM+T3Tgh7ypqeUm3FpKwVNs i+rQFJEyIuVTj0s0Tv0MSBptF9g4JP/4akhWXj+SVaC5mennNEpe6yKpBDsy/Id7ZGWO5C Xb4O5ty7zTbQs/W8wa4Ar5JhToOpSTnmHYeSqn5sfqBGU5+y5RKkkbvIVu/PBuXoB7JeOx ksYzdsmVvYf7zEUrbXSweSdEoi8tM0ruqtYvIsPnh3MVlx3oMkqx1MdpQTmbFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741860869; a=rsa-sha256; cv=none; b=RJkLQkXDev69RPONYZzv1hseY59hn0kByO9+1AddlW/1U0+eCDjK7ThTZJUx6y+aCtA7aX TdWIZLxiZvJygTxdjNS8JnX8gj47Q50/AavdCMl+lWT6FmG41rXFl3pfh4HTSa6lk+2MO+ DOEcvyQjqNSG6jNXGok46qCqrL3y2zcgyRFJCIhJvcEueDoFH4K5i8s1vQ/kEfBhMnpvw4 UvyXe33N2PcNnfl89e7+fLlVLRHtkj0S0Kuxub3Qpyf7S9LoVlo2QlusQvRETbZ3IsqBVV 2OtnhFvhIBggsxbNicIBm2ViCYxylDpUoIoNpWGk/J+labwg7vzITckLozH9ag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741860869; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XWCHRJ1JliREv3kBYdsB6MeCs2G/ON0JyM3mxo9nt34=; b=Q59axMhcSxPs8sPyeR6C+tR3jSZgeIolyQUYLV1kYuJMQaOma1hn01E/mpDyEvHSNbBNep /hXmQKsrAJIdg0/m3b8SxWZQaRe87gQdHA6sFRbkS/2MazK5+LAdjRe8nnevEW16ShZwpH EUU53cmRYqbkbaLPnvA7Qk4KGZsh5tVjtNjGBG2pfkztHV39Ow0M5el8ENxlXmuiYMn0xc 8yX7IHK+96HMnhQ+YFEfqLVEit+pZk5F2yV5VXEpXIx5DAF9iOQU83TfBVfWcTjFLwvWNK zq1WC2m0jf+lzTsbkftYBeXajTPU13BjSFHM7KJif4dfmwQr1O2zcWUU3dPfpQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ZD3JP1d1Cztx4; Thu, 13 Mar 2025 10:14:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 52DAETZf091941; Thu, 13 Mar 2025 10:14:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 52DAETCC091938; Thu, 13 Mar 2025 10:14:29 GMT (envelope-from git) Date: Thu, 13 Mar 2025 10:14:29 GMT Message-Id: <202503131014.52DAETCC091938@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 2ed4c9d94dc6 - stable/14 - if_clone: Use static initializers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2ed4c9d94dc64a453908984942b9dadbbaa5536e Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=2ed4c9d94dc64a453908984942b9dadbbaa5536e commit 2ed4c9d94dc64a453908984942b9dadbbaa5536e Author: Zhenlei Huang AuthorDate: 2025-03-06 04:51:44 +0000 Commit: Zhenlei Huang CommitDate: 2025-03-13 10:13:50 +0000 if_clone: Use static initializers While here, remove vnet_if_clone_init() which is therefore an empty function. MFC after: 1 week (cherry picked from commit 1ba655149ed0447f93e997a60330d9b962d061f2) --- sys/net/if.c | 1 - sys/net/if_clone.c | 9 +-------- sys/net/if_clone.h | 1 - 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index 4bc626b2de75..cf8df9a05d86 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -435,7 +435,6 @@ vnet_if_init(const void *unused __unused) CK_STAILQ_INIT(&V_ifnet); CK_STAILQ_INIT(&V_ifg_head); - vnet_if_clone_init(); } VNET_SYSINIT(vnet_if_init, SI_SUB_INIT_IF, SI_ORDER_SECOND, vnet_if_init, NULL); diff --git a/sys/net/if_clone.c b/sys/net/if_clone.c index 50ebed285d28..9f0dc7cd9649 100644 --- a/sys/net/if_clone.c +++ b/sys/net/if_clone.c @@ -130,7 +130,7 @@ static int ifc_advanced_create_wrapper(struct if_clone *ifc, char *name, size_t static struct mtx if_cloners_mtx; MTX_SYSINIT(if_cloners_lock, &if_cloners_mtx, "if_cloners lock", MTX_DEF); VNET_DEFINE_STATIC(int, if_cloners_count); -VNET_DEFINE(LIST_HEAD(, if_clone), if_cloners); +VNET_DEFINE(LIST_HEAD(, if_clone), if_cloners) = LIST_HEAD_INITIALIZER(); #define V_if_cloners_count VNET(if_cloners_count) #define V_if_cloners VNET(if_cloners) @@ -185,13 +185,6 @@ VNET_DEFINE(LIST_HEAD(, if_clone), if_cloners); static MALLOC_DEFINE(M_CLONE, "clone", "interface cloning framework"); -void -vnet_if_clone_init(void) -{ - - LIST_INIT(&V_if_cloners); -} - /* * Lookup and create a clone network interface. */ diff --git a/sys/net/if_clone.h b/sys/net/if_clone.h index 86aa52c0ed25..8206af53a07b 100644 --- a/sys/net/if_clone.h +++ b/sys/net/if_clone.h @@ -150,7 +150,6 @@ typedef void (*if_clone_event_handler_t)(void *, struct if_clone *); EVENTHANDLER_DECLARE(if_clone_event, if_clone_event_handler_t); /* The below interfaces used only by net/if.c. */ -void vnet_if_clone_init(void); int if_clone_create(char *, size_t, caddr_t); int if_clone_destroy(const char *); int if_clone_list(struct if_clonereq *);