|
|
@@ -1513,9 +1513,10 @@ static int marvell_get_sset_count(struct phy_device *phydev)
|
|
|
|
|
|
static void marvell_get_strings(struct phy_device *phydev, u8 *data)
|
|
|
{
|
|
|
+ int count = marvell_get_sset_count(phydev);
|
|
|
int i;
|
|
|
|
|
|
- for (i = 0; i < ARRAY_SIZE(marvell_hw_stats); i++) {
|
|
|
+ for (i = 0; i < count; i++) {
|
|
|
strlcpy(data + i * ETH_GSTRING_LEN,
|
|
|
marvell_hw_stats[i].string, ETH_GSTRING_LEN);
|
|
|
}
|
|
|
@@ -1543,9 +1544,10 @@ static u64 marvell_get_stat(struct phy_device *phydev, int i)
|
|
|
static void marvell_get_stats(struct phy_device *phydev,
|
|
|
struct ethtool_stats *stats, u64 *data)
|
|
|
{
|
|
|
+ int count = marvell_get_sset_count(phydev);
|
|
|
int i;
|
|
|
|
|
|
- for (i = 0; i < ARRAY_SIZE(marvell_hw_stats); i++)
|
|
|
+ for (i = 0; i < count; i++)
|
|
|
data[i] = marvell_get_stat(phydev, i);
|
|
|
}
|
|
|
|