revert android-tegra-2.6.36-honeycomb-mr1-9001adc to v2.6.36
[firefly-linux-kernel-4.4.55.git] / drivers / usb / gadget / rndis.c
index 116347b0bf1373586e533c4cea0bc76f563eef32..972d5ddd1e18043f23281b3282681c6c9eb0ea62 100644 (file)
@@ -159,25 +159,6 @@ static const u32 oid_supported_list [] =
 #endif /* RNDIS_PM */
 };
 
-/* HACK: copied from net/core/dev.c to replace dev_get_stats since
- * dev_get_stats cannot be called from atomic context */
-static void netdev_stats_to_stats64(struct rtnl_link_stats64 *stats64,
-                                   const struct net_device_stats *netdev_stats)
-{
-#if BITS_PER_LONG == 64
-       BUILD_BUG_ON(sizeof(*stats64) != sizeof(*netdev_stats));
-       memcpy(stats64, netdev_stats, sizeof(*stats64));
-#else
-       size_t i, n = sizeof(*stats64) / sizeof(u64);
-       const unsigned long *src = (const unsigned long *)netdev_stats;
-       u64 *dst = (u64 *)stats64;
-
-       BUILD_BUG_ON(sizeof(*netdev_stats) / sizeof(unsigned long) !=
-                    sizeof(*stats64) / sizeof(u64));
-       for (i = 0; i < n; i++)
-               dst[i] = src[i];
-#endif
-}
 
 /* NDIS Functions */
 static int
@@ -191,7 +172,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
        rndis_query_cmplt_type  *resp;
        struct net_device       *net;
        struct rtnl_link_stats64 temp;
-       struct rtnl_link_stats64 *stats = &temp;
+       const struct rtnl_link_stats64 *stats;
 
        if (!r) return -ENOMEM;
        resp = (rndis_query_cmplt_type *) r->buf;
@@ -214,7 +195,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
        resp->InformationBufferOffset = cpu_to_le32 (16);
 
        net = rndis_per_dev_params[configNr].dev;
-       netdev_stats_to_stats64(stats, &net->stats);
+       stats = dev_get_stats(net, &temp);
 
        switch (OID) {