git: 3df6b1d39af5 - stable/13 - iflib: Remove redundant variable
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 24 Aug 2023 21:15:18 UTC
The branch stable/13 has been updated by erj:
URL: https://cgit.FreeBSD.org/src/commit/?id=3df6b1d39af58620edf59be076ab134bf90e083d
commit 3df6b1d39af58620edf59be076ab134bf90e083d
Author: Eric Joyner <erj@FreeBSD.org>
AuthorDate: 2023-08-04 17:57:11 +0000
Commit: Eric Joyner <erj@FreeBSD.org>
CommitDate: 2023-08-24 21:07:22 +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@
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D41325
(cherry picked from commit d2dd3d5a989d1a2c9ebfbb90a1e682d3ad9db3c3)
---
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 2ee246170211..2a0181fa2d77 100644
--- a/sys/net/iflib.c
+++ b/sys/net/iflib.c
@@ -2456,7 +2456,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;
@@ -2486,7 +2485,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
@@ -2508,7 +2507,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;
@@ -2526,7 +2525,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);