net/mlx5e: Use ethtool_sprintf/puts() to fill priv flags strings
Use ethtool_sprintf/puts() helper functions which handle the common pattern of printing a string into the ethtool strings interface and incrementing the string pointer by ETH_GSTRING_LEN. Signed-off-by: Gal Pressman <gal@nvidia.com> Reviewed-by: Tariq Toukan <tariqt@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://lore.kernel.org/r/20240402133043.56322-2-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
8c73e8b595
commit
e2d515eb8f
@@ -269,8 +269,7 @@ void mlx5e_ethtool_get_strings(struct mlx5e_priv *priv, u32 stringset, u8 *data)
|
||||
switch (stringset) {
|
||||
case ETH_SS_PRIV_FLAGS:
|
||||
for (i = 0; i < MLX5E_NUM_PFLAGS; i++)
|
||||
strcpy(data + i * ETH_GSTRING_LEN,
|
||||
mlx5e_priv_flags[i].name);
|
||||
ethtool_puts(&data, mlx5e_priv_flags[i].name);
|
||||
break;
|
||||
|
||||
case ETH_SS_TEST:
|
||||
|
||||
Reference in New Issue
Block a user