mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 08:02:27 +02:00
amd-xgbe: use ethtool string helpers
The latter is the preferred way to copy ethtool strings. Avoids manually incrementing the pointer. Signed-off-by: Rosen Penev <rosenp@gmail.com> Acked-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20241022233203.9670-1-rosenp@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
ae2930b0b3
commit
cf57ee1601
|
|
@ -195,23 +195,19 @@ static void xgbe_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
|
|||
|
||||
switch (stringset) {
|
||||
case ETH_SS_STATS:
|
||||
for (i = 0; i < XGBE_STATS_COUNT; i++) {
|
||||
memcpy(data, xgbe_gstring_stats[i].stat_string,
|
||||
ETH_GSTRING_LEN);
|
||||
data += ETH_GSTRING_LEN;
|
||||
}
|
||||
for (i = 0; i < XGBE_STATS_COUNT; i++)
|
||||
ethtool_puts(&data, xgbe_gstring_stats[i].stat_string);
|
||||
|
||||
for (i = 0; i < pdata->tx_ring_count; i++) {
|
||||
sprintf(data, "txq_%u_packets", i);
|
||||
data += ETH_GSTRING_LEN;
|
||||
sprintf(data, "txq_%u_bytes", i);
|
||||
data += ETH_GSTRING_LEN;
|
||||
ethtool_sprintf(&data, "txq_%u_packets", i);
|
||||
ethtool_sprintf(&data, "txq_%u_bytes", i);
|
||||
}
|
||||
|
||||
for (i = 0; i < pdata->rx_ring_count; i++) {
|
||||
sprintf(data, "rxq_%u_packets", i);
|
||||
data += ETH_GSTRING_LEN;
|
||||
sprintf(data, "rxq_%u_bytes", i);
|
||||
data += ETH_GSTRING_LEN;
|
||||
ethtool_sprintf(&data, "rxq_%u_packets", i);
|
||||
ethtool_sprintf(&data, "rxq_%u_bytes", i);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user