]> www.infradead.org Git - users/hch/configfs.git/commitdiff
net/mlx4_en: Use ethtool_puts to fill priv flags strings
authorKamal Heib <kheib@redhat.com>
Mon, 17 Jun 2024 17:23:27 +0000 (13:23 -0400)
committerJakub Kicinski <kuba@kernel.org>
Wed, 19 Jun 2024 01:19:18 +0000 (18:19 -0700)
Use the ethtool_puts helper to print the priv flags strings into the
ethtool strings interface.

Signed-off-by: Kamal Heib <kheib@redhat.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240617172329.239819-2-kheib@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c

index 619e1c3ef7f910ecc52795f045933b68ec4e1bee..50a4a017a3f4adf6a397e7259036d35e4015f368 100644 (file)
@@ -536,8 +536,7 @@ static void mlx4_en_get_strings(struct net_device *dev,
                break;
        case ETH_SS_PRIV_FLAGS:
                for (i = 0; i < ARRAY_SIZE(mlx4_en_priv_flags); i++)
-                       strcpy(data + i * ETH_GSTRING_LEN,
-                              mlx4_en_priv_flags[i]);
+                       ethtool_puts(&data, mlx4_en_priv_flags[i]);
                break;
 
        }