diff options
author | sephe <sephe@FreeBSD.org> | 2016-06-13 08:44:29 +0000 |
---|---|---|
committer | sephe <sephe@FreeBSD.org> | 2016-06-13 08:44:29 +0000 |
commit | 0cd4027b2355193e76f5ccd31d0aea316bc1984d (patch) | |
tree | ff7ec8c3d50a0ff68e50a468378ea345bc588907 /sys/dev | |
parent | 93d05cf6a6f115d144df573508a69376a94c974b (diff) | |
download | FreeBSD-src-0cd4027b2355193e76f5ccd31d0aea316bc1984d.zip FreeBSD-src-0cd4027b2355193e76f5ccd31d0aea316bc1984d.tar.gz |
hyperv/hn: Hide unused function
Sponsored by: Microsoft OSTC
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c b/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c index 754c8ee..0f4425e 100644 --- a/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c +++ b/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c @@ -294,9 +294,10 @@ static int hn_trust_hcsum_sysctl(SYSCTL_HANDLER_ARGS); static int hn_tx_chimney_size_sysctl(SYSCTL_HANDLER_ARGS); #if __FreeBSD_version < 1100095 static int hn_rx_stat_int_sysctl(SYSCTL_HANDLER_ARGS); +#else +static int hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARGS); #endif static int hn_rx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS); -static int hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARGS); static int hn_tx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS); static int hn_tx_conf_int_sysctl(SYSCTL_HANDLER_ARGS); static int hn_check_iplen(const struct mbuf *, int); @@ -1825,56 +1826,57 @@ hn_rx_stat_int_sysctl(SYSCTL_HANDLER_ARGS) } return 0; } -#endif - +#else static int -hn_rx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS) +hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARGS) { struct hn_softc *sc = arg1; int ofs = arg2, i, error; struct hn_rx_ring *rxr; - u_long stat; + uint64_t stat; stat = 0; for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { rxr = &sc->hn_rx_ring[i]; - stat += *((u_long *)((uint8_t *)rxr + ofs)); + stat += *((uint64_t *)((uint8_t *)rxr + ofs)); } - error = sysctl_handle_long(oidp, &stat, 0, req); + error = sysctl_handle_64(oidp, &stat, 0, req); if (error || req->newptr == NULL) return error; /* Zero out this stat. */ for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { rxr = &sc->hn_rx_ring[i]; - *((u_long *)((uint8_t *)rxr + ofs)) = 0; + *((uint64_t *)((uint8_t *)rxr + ofs)) = 0; } return 0; } +#endif + static int -hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARGS) +hn_rx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS) { struct hn_softc *sc = arg1; int ofs = arg2, i, error; struct hn_rx_ring *rxr; - uint64_t stat; + u_long stat; stat = 0; for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { rxr = &sc->hn_rx_ring[i]; - stat += *((uint64_t *)((uint8_t *)rxr + ofs)); + stat += *((u_long *)((uint8_t *)rxr + ofs)); } - error = sysctl_handle_64(oidp, &stat, 0, req); + error = sysctl_handle_long(oidp, &stat, 0, req); if (error || req->newptr == NULL) return error; /* Zero out this stat. */ for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { rxr = &sc->hn_rx_ring[i]; - *((uint64_t *)((uint8_t *)rxr + ofs)) = 0; + *((u_long *)((uint8_t *)rxr + ofs)) = 0; } return 0; } |