git: 2498e94fb6bb - stable/13 - msk: Remove write only variables, but leave hardware reads in place

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Fri, 11 Nov 2022 18:37:02 UTC
The branch stable/13 has been updated by jhb:

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

commit 2498e94fb6bbe320df6a6c99be742e0277021d7d
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2022-04-06 02:01:47 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-11-11 18:18:54 +0000

    msk: Remove write only variables, but leave hardware reads in place
    
    Sponsored by:           Netflix
    
    (cherry picked from commit 7e5c042cced9f2fba00133af25ea0ee96f435f5d)
---
 sys/dev/msk/if_msk.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/sys/dev/msk/if_msk.c b/sys/dev/msk/if_msk.c
index cf206c8f7971..73c6b4fa5458 100644
--- a/sys/dev/msk/if_msk.c
+++ b/sys/dev/msk/if_msk.c
@@ -4311,7 +4311,6 @@ static void
 msk_stats_clear(struct msk_if_softc *sc_if)
 {
 	struct msk_softc *sc;
-	uint32_t reg;
 	uint16_t gmac;
 	int i;
 
@@ -4323,7 +4322,7 @@ msk_stats_clear(struct msk_if_softc *sc_if)
 	GMAC_WRITE_2(sc, sc_if->msk_port, GM_PHY_ADDR, gmac | GM_PAR_MIB_CLR);
 	/* Read all MIB Counters with Clear Mode set. */
 	for (i = GM_RXF_UC_OK; i <= GM_TXE_FIFO_UR; i += sizeof(uint32_t))
-		reg = MSK_READ_MIB32(sc_if->msk_port, i);
+		MSK_READ_MIB32(sc_if->msk_port, i);
 	/* Clear MIB Clear Counter Mode. */
 	gmac &= ~GM_PAR_MIB_CLR;
 	GMAC_WRITE_2(sc, sc_if->msk_port, GM_PHY_ADDR, gmac);
@@ -4336,7 +4335,6 @@ msk_stats_update(struct msk_if_softc *sc_if)
 	struct ifnet *ifp;
 	struct msk_hw_stats *stats;
 	uint16_t gmac;
-	uint32_t reg;
 
 	MSK_IF_LOCK_ASSERT(sc_if);
 
@@ -4360,7 +4358,7 @@ msk_stats_update(struct msk_if_softc *sc_if)
 	    MSK_READ_MIB32(sc_if->msk_port, GM_RXF_MC_OK);
 	stats->rx_crc_errs +=
 	    MSK_READ_MIB32(sc_if->msk_port, GM_RXF_FCS_ERR);
-	reg = MSK_READ_MIB32(sc_if->msk_port, GM_RXF_SPARE1);
+	MSK_READ_MIB32(sc_if->msk_port, GM_RXF_SPARE1);
 	stats->rx_good_octets +=
 	    MSK_READ_MIB64(sc_if->msk_port, GM_RXO_OK_LO);
 	stats->rx_bad_octets +=
@@ -4387,10 +4385,10 @@ msk_stats_update(struct msk_if_softc *sc_if)
 	    MSK_READ_MIB32(sc_if->msk_port, GM_RXF_LNG_ERR);
 	stats->rx_pkts_jabbers +=
 	    MSK_READ_MIB32(sc_if->msk_port, GM_RXF_JAB_PKT);
-	reg = MSK_READ_MIB32(sc_if->msk_port, GM_RXF_SPARE2);
+	MSK_READ_MIB32(sc_if->msk_port, GM_RXF_SPARE2);
 	stats->rx_fifo_oflows +=
 	    MSK_READ_MIB32(sc_if->msk_port, GM_RXE_FIFO_OV);
-	reg = MSK_READ_MIB32(sc_if->msk_port, GM_RXF_SPARE3);
+	MSK_READ_MIB32(sc_if->msk_port, GM_RXF_SPARE3);
 
 	/* Tx stats. */
 	stats->tx_ucast_frames +=
@@ -4417,7 +4415,7 @@ msk_stats_update(struct msk_if_softc *sc_if)
 	    MSK_READ_MIB32(sc_if->msk_port, GM_TXF_1518B);
 	stats->tx_pkts_1519_max +=
 	    MSK_READ_MIB32(sc_if->msk_port, GM_TXF_MAX_SZ);
-	reg = MSK_READ_MIB32(sc_if->msk_port, GM_TXF_SPARE1);
+	MSK_READ_MIB32(sc_if->msk_port, GM_TXF_SPARE1);
 	stats->tx_colls +=
 	    MSK_READ_MIB32(sc_if->msk_port, GM_TXF_COL);
 	stats->tx_late_colls +=