git: b3ace70370e4 - stable/13 - xl_attach: eliminate write only variable unit

From: Warner Losh <imp_at_FreeBSD.org>
Date: Sun, 02 Oct 2022 04:30:05 UTC
The branch stable/13 has been updated by imp:

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

commit b3ace70370e45876e7580724515f6e23f8f9807e
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2022-07-08 17:53:34 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2022-10-02 04:25:56 +0000

    xl_attach: eliminate write only variable unit
    
    Sponsored by:           Netflix
    
    (cherry picked from commit c972f2c065bdb7031e7935aac406365e4810df19)
---
 sys/dev/xl/if_xl.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sys/dev/xl/if_xl.c b/sys/dev/xl/if_xl.c
index ca6184758815..ae4d9fb8f5ff 100644
--- a/sys/dev/xl/if_xl.c
+++ b/sys/dev/xl/if_xl.c
@@ -1069,14 +1069,12 @@ xl_attach(device_t dev)
 	struct xl_softc		*sc;
 	struct ifnet		*ifp;
 	int			media, pmcap;
-	int			error = 0, phy, rid, res, unit;
+	int			error = 0, phy, rid, res;
 	uint16_t		did;
 
 	sc = device_get_softc(dev);
 	sc->xl_dev = dev;
 
-	unit = device_get_unit(dev);
-
 	mtx_init(&sc->xl_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
 	    MTX_DEF);
 	ifmedia_init(&sc->ifmedia, 0, xl_ifmedia_upd, xl_ifmedia_sts);