Author: sephe
Date: Mon Jun 13 08:44:29 2016
New Revision: 301865
URL: https://svnweb.freebsd.org/changeset/base/301865

Log:
  hyperv/hn: Hide unused function
  
  Sponsored by: Microsoft OSTC

Modified:
  stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c

Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==============================================================================
--- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c     Mon Jun 13 
08:38:04 2016        (r301864)
+++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c     Mon Jun 13 
08:44:29 2016        (r301865)
@@ -294,9 +294,10 @@ static int hn_trust_hcsum_sysctl(SYSCTL_
 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_ARG
        }
        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;
 }
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "[email protected]"

Reply via email to