diff options
Diffstat (limited to 'drivers/net/ethernet/intel/igb/igb_ethtool.c')
| -rw-r--r-- | drivers/net/ethernet/intel/igb/igb_ethtool.c | 41 | 
1 files changed, 15 insertions, 26 deletions
| diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c index 28baf203459a..7545da216d8b 100644 --- a/drivers/net/ethernet/intel/igb/igb_ethtool.c +++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c @@ -2347,35 +2347,23 @@ static void igb_get_strings(struct net_device *netdev, u32 stringset, u8 *data)  			IGB_TEST_LEN*ETH_GSTRING_LEN);  		break;  	case ETH_SS_STATS: -		for (i = 0; i < IGB_GLOBAL_STATS_LEN; i++) { -			memcpy(p, igb_gstrings_stats[i].stat_string, -			       ETH_GSTRING_LEN); -			p += ETH_GSTRING_LEN; -		} -		for (i = 0; i < IGB_NETDEV_STATS_LEN; i++) { -			memcpy(p, igb_gstrings_net_stats[i].stat_string, -			       ETH_GSTRING_LEN); -			p += ETH_GSTRING_LEN; -		} +		for (i = 0; i < IGB_GLOBAL_STATS_LEN; i++) +			ethtool_sprintf(&p, +					igb_gstrings_stats[i].stat_string); +		for (i = 0; i < IGB_NETDEV_STATS_LEN; i++) +			ethtool_sprintf(&p, +					igb_gstrings_net_stats[i].stat_string);  		for (i = 0; i < adapter->num_tx_queues; i++) { -			sprintf(p, "tx_queue_%u_packets", i); -			p += ETH_GSTRING_LEN; -			sprintf(p, "tx_queue_%u_bytes", i); -			p += ETH_GSTRING_LEN; -			sprintf(p, "tx_queue_%u_restart", i); -			p += ETH_GSTRING_LEN; +			ethtool_sprintf(&p, "tx_queue_%u_packets", i); +			ethtool_sprintf(&p, "tx_queue_%u_bytes", i); +			ethtool_sprintf(&p, "tx_queue_%u_restart", i);  		}  		for (i = 0; i < adapter->num_rx_queues; i++) { -			sprintf(p, "rx_queue_%u_packets", i); -			p += ETH_GSTRING_LEN; -			sprintf(p, "rx_queue_%u_bytes", i); -			p += ETH_GSTRING_LEN; -			sprintf(p, "rx_queue_%u_drops", i); -			p += ETH_GSTRING_LEN; -			sprintf(p, "rx_queue_%u_csum_err", i); -			p += ETH_GSTRING_LEN; -			sprintf(p, "rx_queue_%u_alloc_failed", i); -			p += ETH_GSTRING_LEN; +			ethtool_sprintf(&p, "rx_queue_%u_packets", i); +			ethtool_sprintf(&p, "rx_queue_%u_bytes", i); +			ethtool_sprintf(&p, "rx_queue_%u_drops", i); +			ethtool_sprintf(&p, "rx_queue_%u_csum_err", i); +			ethtool_sprintf(&p, "rx_queue_%u_alloc_failed", i);  		}  		/* BUG_ON(p - data != IGB_STATS_LEN * ETH_GSTRING_LEN); */  		break; @@ -3022,6 +3010,7 @@ static int igb_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd)  		break;  	case ETHTOOL_SRXCLSRLDEL:  		ret = igb_del_ethtool_nfc_entry(adapter, cmd); +		break;  	default:  		break;  	} | 
