Skip to content

Commit bb5135d

Browse files
committed
iflib: Make iflib_register() return void
It never fails since change [1]. No functional change intended. [1] aa38608 net: Remove unneeded NULL check for the allocated ifnet Reviewed by: kbowling, #iflib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D50713
1 parent 8321d0d commit bb5135d

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

sys/net/iflib.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ static uint32_t iflib_txq_can_drain(struct ifmp_ring *);
712712
static void iflib_altq_if_start(if_t ifp);
713713
static int iflib_altq_if_transmit(if_t ifp, struct mbuf *m);
714714
#endif
715-
static int iflib_register(if_ctx_t);
715+
static void iflib_register(if_ctx_t);
716716
static void iflib_deregister(if_ctx_t);
717717
static void iflib_unregister_vlan_handlers(if_ctx_t ctx);
718718
static uint16_t iflib_get_mbuf_size_for(unsigned int size);
@@ -5136,10 +5136,7 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct
51365136
ctx->ifc_dev = dev;
51375137
ctx->ifc_softc = sc;
51385138

5139-
if ((err = iflib_register(ctx)) != 0) {
5140-
device_printf(dev, "iflib_register failed %d\n", err);
5141-
goto fail_ctx_free;
5142-
}
5139+
iflib_register(ctx);
51435140
iflib_add_device_sysctl_pre(ctx);
51445141

51455142
scctx = &ctx->ifc_softc_ctx;
@@ -5387,7 +5384,6 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct
53875384
CTX_UNLOCK(ctx);
53885385
IFNET_WUNLOCK();
53895386
iflib_deregister(ctx);
5390-
fail_ctx_free:
53915387
device_set_softc(ctx->ifc_dev, NULL);
53925388
if (ctx->ifc_flags & IFC_SC_ALLOCATED)
53935389
free(ctx->ifc_softc, M_IFLIB);
@@ -5685,7 +5681,7 @@ _iflib_pre_assert(if_softc_ctx_t scctx)
56855681
MPASS(scctx->isc_txrx->ift_rxd_flush);
56865682
}
56875683

5688-
static int
5684+
static void
56895685
iflib_register(if_ctx_t ctx)
56905686
{
56915687
if_shared_ctx_t sctx = ctx->ifc_sctx;
@@ -5731,7 +5727,6 @@ iflib_register(if_ctx_t ctx)
57315727
ifmedia_init(ctx->ifc_mediap, IFM_IMASK,
57325728
iflib_media_change, iflib_media_status);
57335729
}
5734-
return (0);
57355730
}
57365731

57375732
static void

0 commit comments

Comments
 (0)