git: 8d6bc14c5474 - stable/14 - iflib: Make iflib_register() return void

From: Zhenlei Huang <zlei_at_FreeBSD.org>
Date: Sat, 27 Sep 2025 15:13:55 UTC
The branch stable/14 has been updated by zlei:

URL: https://cgit.FreeBSD.org/src/commit/?id=8d6bc14c547472aafeddae65ae64024a24c5c5a7

commit 8d6bc14c547472aafeddae65ae64024a24c5c5a7
Author:     Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2025-08-30 15:23:51 +0000
Commit:     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2025-09-27 15:11:35 +0000

    iflib: Make iflib_register() return void
    
    It never fails since change [1]. No functional change intended.
    
    [1] aa3860851b9f net: Remove unneeded NULL check for the allocated ifnet
    
    Reviewed by:    kbowling, #iflib
    MFC after:      2 weeks
    Differential Revision:  https://reviews.freebsd.org/D50713
    
    (cherry picked from commit bb5135d0f2276e84b7abfcc481c92000647f68d4)
---
 sys/net/iflib.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/sys/net/iflib.c b/sys/net/iflib.c
index dc93da722ef4..1113a5e8e9f4 100644
--- a/sys/net/iflib.c
+++ b/sys/net/iflib.c
@@ -709,7 +709,7 @@ static uint32_t iflib_txq_can_drain(struct ifmp_ring *);
 static void iflib_altq_if_start(if_t ifp);
 static int iflib_altq_if_transmit(if_t ifp, struct mbuf *m);
 #endif
-static int iflib_register(if_ctx_t);
+static void iflib_register(if_ctx_t);
 static void iflib_deregister(if_ctx_t);
 static void iflib_unregister_vlan_handlers(if_ctx_t ctx);
 static uint16_t iflib_get_mbuf_size_for(unsigned int size);
@@ -5214,10 +5214,7 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct
 	ctx->ifc_dev = dev;
 	ctx->ifc_softc = sc;
 
-	if ((err = iflib_register(ctx)) != 0) {
-		device_printf(dev, "iflib_register failed %d\n", err);
-		goto fail_ctx_free;
-	}
+	iflib_register(ctx);
 	iflib_add_device_sysctl_pre(ctx);
 
 	scctx = &ctx->ifc_softc_ctx;
@@ -5458,7 +5455,6 @@ fail_unlock:
 	CTX_UNLOCK(ctx);
 	IFNET_WUNLOCK();
 	iflib_deregister(ctx);
-fail_ctx_free:
 	device_set_softc(ctx->ifc_dev, NULL);
 	if (ctx->ifc_flags & IFC_SC_ALLOCATED)
 		free(ctx->ifc_softc, M_IFLIB);
@@ -5756,7 +5752,7 @@ _iflib_pre_assert(if_softc_ctx_t scctx)
 	MPASS(scctx->isc_txrx->ift_rxd_flush);
 }
 
-static int
+static void
 iflib_register(if_ctx_t ctx)
 {
 	if_shared_ctx_t sctx = ctx->ifc_sctx;
@@ -5802,7 +5798,6 @@ iflib_register(if_ctx_t ctx)
 		ifmedia_init(ctx->ifc_mediap, IFM_IMASK,
 		    iflib_media_change, iflib_media_status);
 	}
-	return (0);
 }
 
 static void