From: Matt Carlson Date: Thu, 8 Dec 2011 14:40:13 +0000 (+0000) Subject: tg3: Remove ethtool stats member from dev struct X-Git-Tag: v2.6.39-400.9.0~423^2~19^2~11^2~654 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=581647e07b62e9da7fb94a0930a815e479ef5cfb;p=users%2Fjedix%2Flinux-maple.git tg3: Remove ethtool stats member from dev struct This patch removes the ethtool stats member from the tg3 device structure. (cherry picked from commit 0e6c9da35ef774109a1b5740144c9d442bd5a5b5) Signed-off-by: Matt Carlson Signed-off-by: Michael Chan Reviewed-by: Ben Hutchings Signed-off-by: David S. Miller Signed-off-by: Joe Jin --- diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index f497d415db1f..5c7e872779ca 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c @@ -9790,7 +9790,8 @@ err_out1: static struct rtnl_link_stats64 *tg3_get_stats64(struct net_device *, struct rtnl_link_stats64 *); -static struct tg3_ethtool_stats *tg3_get_estats(struct tg3 *); +static struct tg3_ethtool_stats *tg3_get_estats(struct tg3 *, + struct tg3_ethtool_stats *); static int tg3_close(struct net_device *dev) { @@ -9824,9 +9825,7 @@ static int tg3_close(struct net_device *dev) tg3_ints_fini(tp); tg3_get_stats64(tp->dev, &tp->net_stats_prev); - - memcpy(&tp->estats_prev, tg3_get_estats(tp), - sizeof(tp->estats_prev)); + tg3_get_estats(tp, &tp->estats_prev); tg3_napi_fini(tp); @@ -9874,9 +9873,9 @@ static u64 calc_crc_errors(struct tg3 *tp) estats->member = old_estats->member + \ get_stat64(&hw_stats->member) -static struct tg3_ethtool_stats *tg3_get_estats(struct tg3 *tp) +static struct tg3_ethtool_stats *tg3_get_estats(struct tg3 *tp, + struct tg3_ethtool_stats *estats) { - struct tg3_ethtool_stats *estats = &tp->estats; struct tg3_ethtool_stats *old_estats = &tp->estats_prev; struct tg3_hw_stats *hw_stats = tp->hw_stats; @@ -10782,7 +10781,8 @@ static void tg3_get_ethtool_stats(struct net_device *dev, struct ethtool_stats *estats, u64 *tmp_stats) { struct tg3 *tp = netdev_priv(dev); - memcpy(tmp_stats, tg3_get_estats(tp), sizeof(tp->estats)); + + tg3_get_estats(tp, (struct tg3_ethtool_stats *)tmp_stats); } static __be32 *tg3_vpd_readblock(struct tg3 *tp, u32 *vpdlen) diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h index dfe75c015b57..28d80f84c663 100644 --- a/drivers/net/tg3.h +++ b/drivers/net/tg3.h @@ -3009,7 +3009,6 @@ struct tg3 { unsigned long rx_dropped; unsigned long tx_dropped; struct rtnl_link_stats64 net_stats_prev; - struct tg3_ethtool_stats estats; struct tg3_ethtool_stats estats_prev; DECLARE_BITMAP(tg3_flags, TG3_FLAG_NUMBER_OF_FLAGS);