Skip to content

Commit 8e0ff0b

Browse files
committed
net: ethernet: move from strlcpy with unused retval to strscpy
Author: Wolfram Sang <wsa+renesas@sang-engineering.com> Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Petr Machata <petrm@nvidia.com> # For drivers/net/ethernet/mellanox/mlxsw Acked-by: Geoff Levand <geoff@infradead.org> # For ps3_gelic_net and spider_net_ethtool Acked-by: Tom Lendacky <thomas.lendacky@amd.com> # For drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c Acked-by: Marcin Wojtas <mw@semihalf.com> # For drivers/net/ethernet/marvell/mvpp2 Reviewed-by: Leon Romanovsky <leonro@nvidia.com> # For drivers/net/ethernet/mellanox/mlx{4|5} Reviewed-by: Shay Agroskin <shayagr@amazon.com> # For drivers/net/ethernet/amazon/ena Acked-by: Krzysztof Hałasa <khalasa@piap.pl> # For IXP4xx Ethernet Link: https://lore.kernel.org/r/20220830201457.7984-3-wsa+renesas@sang-engineering.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> (cherry picked from commit f029c78) Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2100606 Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
1 parent 68f2192 commit 8e0ff0b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,15 +287,15 @@ static void stmmac_ethtool_getdrvinfo(struct net_device *dev,
287287
struct stmmac_priv *priv = netdev_priv(dev);
288288

289289
if (priv->plat->has_gmac || priv->plat->has_gmac4)
290-
strlcpy(info->driver, GMAC_ETHTOOL_NAME, sizeof(info->driver));
290+
strscpy(info->driver, GMAC_ETHTOOL_NAME, sizeof(info->driver));
291291
else if (priv->plat->has_xgmac)
292-
strlcpy(info->driver, XGMAC_ETHTOOL_NAME, sizeof(info->driver));
292+
strscpy(info->driver, XGMAC_ETHTOOL_NAME, sizeof(info->driver));
293293
else
294-
strlcpy(info->driver, MAC100_ETHTOOL_NAME,
294+
strscpy(info->driver, MAC100_ETHTOOL_NAME,
295295
sizeof(info->driver));
296296

297297
if (priv->plat->pdev) {
298-
strlcpy(info->bus_info, pci_name(priv->plat->pdev),
298+
strscpy(info->bus_info, pci_name(priv->plat->pdev),
299299
sizeof(info->bus_info));
300300
}
301301
}

0 commit comments

Comments
 (0)