gianfar: remove largely unused gfar_stats struct
authorPaul Gortmaker <paul.gortmaker@windriver.com>
Tue, 12 Feb 2013 20:28:35 +0000 (15:28 -0500)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Wed, 13 Feb 2013 00:07:42 +0000 (19:07 -0500)
commit68719786cba169f93b6cb5a53f5dd6ea1bdbb9f3
treebb80d64cf352dec80f337924b665974399b0295b
parent0790bbb68f9d483348c1d65381f3dd92602bfd05
gianfar: remove largely unused gfar_stats struct

The gfar_stats struct is only used in copying out data
via ethtool.  It is declared as the extra stats, followed
by the rmon stats.  However, the rmon stats are never
actually ever used in the driver; instead the rmon data
is a u32 register read that is cast directly into the
ethtool buf.

It seems the only reason rmon is in the struct at all is
to give the offset(s) at which it should be exported into
the ethtool buffer.  But note gfar_stats doesn't contain
a gfar_extra_stats as a substruct -- instead it contains
a u64 array of equal element count.  This implicitly means
we have two independent declarations of what gfar_extra_stats
really is.  Rather than have this duality, we already have
defines which give us the offset directly, and hence do not
need the struct at all.

Further, since we know the extra_stats is unconditionally
always present, we can write it out to the ethtool buf
1st, and then optionally write out the rmon data.  There
is no need for two independent loops, both of which are
simply copying out the extra_stats to buf offset zero.

This also helps pave the way towards allowing the extra
stats fields to be converted to atomic64_t values, without
having their types directly influencing the ethtool stats
export code (gfar_fill_stats) that expects to deal with u64.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
drivers/net/ethernet/freescale/gianfar.h
drivers/net/ethernet/freescale/gianfar_ethtool.c
This page took 0.029224 seconds and 5 git commands to generate.