The former is a safer and more readable version.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
int i;
for (i = 0; i < ARRAY_SIZE(ag71xx_statistics); i++)
- memcpy(data + i * ETH_GSTRING_LEN,
- ag71xx_statistics[i].name, ETH_GSTRING_LEN);
+ ethtool_puts(&data, ag71xx_statistics[i].name);
}
}
+ switch (stringset) {
+ case ETH_SS_STATS:
+ for (i = 0; i < ARRAY_SIZE(ipqess_stats); i++)
-+ ethtool_sprintf(&p, ipqess_stats[i].string);
++ ethtool_puts(&p, ipqess_stats[i].string);
+ break;
+ }
+}
{
switch (stringset) {
case ETH_SS_STATS:
- memcpy(data, *fe_gdma_str, sizeof(fe_gdma_str));
+ ethtool_puts(&data, *fe_gdma_str);
break;
}
}
return;
for (int i = 0; i < ARRAY_SIZE(rtl83xx_mib); i++)
- strncpy(data + i * ETH_GSTRING_LEN, rtl83xx_mib[i].name,
- ETH_GSTRING_LEN);
+ ethtool_puts(&data, rtl83xx_mib[i].name);
}
static void rtl83xx_get_ethtool_stats(struct dsa_switch *ds, int port,