git: d2dd3d5a989d - main - iflib: Remove redundant variable

From: Eric Joyner <erj_at_FreeBSD.org>
Date: Mon, 07 Aug 2023 22:47:11 UTC
The branch main has been updated by erj:

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

commit d2dd3d5a989d1a2c9ebfbb90a1e682d3ad9db3c3
Author:     Eric Joyner <erj@FreeBSD.org>
AuthorDate: 2023-08-04 17:57:11 +0000
Commit:     Eric Joyner <erj@FreeBSD.org>
CommitDate: 2023-08-07 22:46:48 +0000

    iflib: Remove redundant variable
    
    In iflib_init_locked(), sctx and scctx both point to the same value,
    which is the ifc_softc_ctx field in the iflib softc. Remove the
    declaration and assignment to sctx since scctx can be used instead, and
    the name of scctx follows the naming convention used for local variables
    that point to ifc_softc_ctx.
    
    In theory there should be no functional impact with this change.
    
    Signed-off-by: Eric Joyner <erj@FreeBSD.org>
    
    Reviewed by:    kbowling@
    MFC after:      3 days
    Sponsored by:   Intel Corporation
    Differential Revision:  https://reviews.freebsd.org/D41325
---
 sys/net/iflib.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/sys/net/iflib.c b/sys/net/iflib.c
index f4c0e5d54cab..ad2afa77b72c 100644
--- a/sys/net/iflib.c
+++ b/sys/net/iflib.c
@@ -2476,7 +2476,6 @@ iflib_get_rx_mbuf_sz(if_ctx_t ctx)
 static void
 iflib_init_locked(if_ctx_t ctx)
 {
-	if_softc_ctx_t sctx = &ctx->ifc_softc_ctx;
 	if_softc_ctx_t scctx = &ctx->ifc_softc_ctx;
 	if_t ifp = ctx->ifc_ifp;
 	iflib_fl_t fl;
@@ -2506,7 +2505,7 @@ iflib_init_locked(if_ctx_t ctx)
 	if (if_getcapenable(ifp) & IFCAP_TSO6)
 		if_sethwassistbits(ifp, CSUM_IP6_TSO, 0);
 
-	for (i = 0, txq = ctx->ifc_txqs; i < sctx->isc_ntxqsets; i++, txq++) {
+	for (i = 0, txq = ctx->ifc_txqs; i < scctx->isc_ntxqsets; i++, txq++) {
 		CALLOUT_LOCK(txq);
 		callout_stop(&txq->ift_timer);
 #ifdef DEV_NETMAP
@@ -2528,7 +2527,7 @@ iflib_init_locked(if_ctx_t ctx)
 #endif
 	IFDI_INIT(ctx);
 	MPASS(if_getdrvflags(ifp) == i);
-	for (i = 0, rxq = ctx->ifc_rxqs; i < sctx->isc_nrxqsets; i++, rxq++) {
+	for (i = 0, rxq = ctx->ifc_rxqs; i < scctx->isc_nrxqsets; i++, rxq++) {
 		if (iflib_netmap_rxq_init(ctx, rxq) > 0) {
 			/* This rxq is in netmap mode. Skip normal init. */
 			continue;
@@ -2546,7 +2545,7 @@ done:
 	if_setdrvflagbits(ctx->ifc_ifp, IFF_DRV_RUNNING, IFF_DRV_OACTIVE);
 	IFDI_INTR_ENABLE(ctx);
 	txq = ctx->ifc_txqs;
-	for (i = 0; i < sctx->isc_ntxqsets; i++, txq++)
+	for (i = 0; i < scctx->isc_ntxqsets; i++, txq++)
 		callout_reset_on(&txq->ift_timer, iflib_timer_default, iflib_timer, txq,
 			txq->ift_timer.c_cpu);