Hello,

When reading over the mue(4) code I noticed that memset() can be used
for clearing hashtbl. Also the switch case for IFM_100_TX was the same
code as for IFM_1000_T so it can be rolled into one.

- Michael


Index: if_mue.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/if_mue.c,v
retrieving revision 1.1
diff -u -p -u -r1.1 if_mue.c
--- if_mue.c    3 Aug 2018 01:50:15 -0000       1.1
+++ if_mue.c    3 Aug 2018 04:50:51 -0000
@@ -301,8 +301,6 @@ mue_miibus_statchg(struct device *dev)
                switch (IFM_SUBTYPE(mii->mii_media_active)) {
                case IFM_10_T:
                case IFM_100_TX:
-                       sc->mue_link++;
-                       break;
                case IFM_1000_T:
                        sc->mue_link++;
                        break;
@@ -969,7 +967,6 @@ mue_iff(struct mue_softc *sc)
        struct ether_multi *enm;
        struct ether_multistep step;
        uint32_t h = 0, hashtbl[MUE_DP_SEL_VHF_HASH_LEN], reg, rxfilt;
-       int i;
 
        if (usbd_is_dying(sc->mue_udev))
                return;
@@ -992,8 +989,7 @@ mue_iff(struct mue_softc *sc)
                rxfilt |= MUE_RFE_CTL_PERFECT | MUE_RFE_CTL_MULTICAST_HASH;
 
                /* Clear hash table. */
-               for (i = 0; i < MUE_DP_SEL_VHF_HASH_LEN; i++)
-                       hashtbl[i] = 0;
+               memset(hashtbl, 0, sizeof(hashtbl));
 
                /* Now program new ones. */
                ETHER_FIRST_MULTI(step, ac, enm);

Reply via email to