diff options
author | Kevin Lo <kevlo@cvs.openbsd.org> | 2018-08-03 06:19:16 +0000 |
---|---|---|
committer | Kevin Lo <kevlo@cvs.openbsd.org> | 2018-08-03 06:19:16 +0000 |
commit | dc2cc35c7027e20d921ccd390a33afe88820c34a (patch) | |
tree | daac850ec6e9a9037f75c775b36ce7537d80d730 /sys/dev/usb | |
parent | 8d1761ac09c8b199a51eddf41eaf71edd87d4090 (diff) |
- use memset() for for clearing hashtbl
- the switch case for IFM_100_TX was the same code as for IFM_1000_T so it
can be rolled into one.
From Michael W. Bombardieri
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/if_mue.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/dev/usb/if_mue.c b/sys/dev/usb/if_mue.c index 8d9308be6da..379e9074eb8 100644 --- a/sys/dev/usb/if_mue.c +++ b/sys/dev/usb/if_mue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mue.c,v 1.1 2018/08/03 01:50:15 kevlo Exp $ */ +/* $OpenBSD: if_mue.c,v 1.2 2018/08/03 06:19:15 kevlo Exp $ */ /* * Copyright (c) 2018 Kevin Lo <kevlo@openbsd.org> @@ -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); |