[<prev] [next>] [day] [month] [year] [list]
Message-ID: <m34jy38mhe.fsf@t19.piap.pl>
Date: Tue, 23 Aug 2022 09:09:33 +0200
From: Krzysztof Hałasa <khalasa@...p.pl>
To: Wolfram Sang <wsa+renesas@...g-engineering.com>
Cc: linux-kernel@...r.kernel.org,
"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] net: move from strlcpy with unused retval to strscpy
Wolfram Sang <wsa+renesas@...g-engineering.com> writes:
> 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.
Looks good to me (IXP4xx Ethernet).
Acked-by: Krzysztof Hałasa <khalasa@...p.pl>
> +++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c
> @@ -999,11 +999,11 @@ static void ixp4xx_get_drvinfo(struct net_device *dev,
> {
> struct port *port = netdev_priv(dev);
>
> - strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
> + strscpy(info->driver, DRV_NAME, sizeof(info->driver));
> snprintf(info->fw_version, sizeof(info->fw_version), "%u:%u:%u:%u",
> port->firmware[0], port->firmware[1],
> port->firmware[2], port->firmware[3]);
> - strlcpy(info->bus_info, "internal", sizeof(info->bus_info));
> + strscpy(info->bus_info, "internal", sizeof(info->bus_info));
> }
>
--
Krzysztof "Chris" Hałasa
Sieć Badawcza Łukasiewicz
Przemysłowy Instytut Automatyki i Pomiarów PIAP
Al. Jerozolimskie 202, 02-486 Warszawa
Powered by blists - more mailing lists