summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/net/if_cdce.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2013-01-28 19:38:13 +0000
committerjhb <jhb@FreeBSD.org>2013-01-28 19:38:13 +0000
commit5df972afb615beef2123a19aeca58e473e3d4e95 (patch)
tree380f661c837f03bdedc0e10252427ed4cde7ed7d /sys/dev/usb/net/if_cdce.c
parent7756bef786978bd5d07c05b55bc8428454d6837d (diff)
downloadFreeBSD-src-5df972afb615beef2123a19aeca58e473e3d4e95.zip
FreeBSD-src-5df972afb615beef2123a19aeca58e473e3d4e95.tar.gz
Mark 'ticks', 'time_second', and 'time_uptime' as volatile to prevent the
compiler from caching their values in tight loops. Reviewed by: bde MFC after: 1 week
Diffstat (limited to 'sys/dev/usb/net/if_cdce.c')
-rw-r--r--sys/dev/usb/net/if_cdce.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/usb/net/if_cdce.c b/sys/dev/usb/net/if_cdce.c
index 6e0ce97..e214fe2 100644
--- a/sys/dev/usb/net/if_cdce.c
+++ b/sys/dev/usb/net/if_cdce.c
@@ -500,6 +500,7 @@ cdce_attach(device_t dev)
const struct usb_interface_descriptor *id;
const struct usb_cdc_ethernet_descriptor *ued;
const struct usb_config *pcfg;
+ uint32_t seed;
int error;
uint8_t i;
uint8_t data_iface_no;
@@ -612,8 +613,9 @@ alloc_transfers:
/* fake MAC address */
device_printf(dev, "faking MAC address\n");
+ seed = ticks;
sc->sc_ue.ue_eaddr[0] = 0x2a;
- memcpy(&sc->sc_ue.ue_eaddr[1], &ticks, sizeof(uint32_t));
+ memcpy(&sc->sc_ue.ue_eaddr[1], &seed, sizeof(uint32_t));
sc->sc_ue.ue_eaddr[5] = device_get_unit(dev);
} else {
OpenPOWER on IntegriCloud