netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Krzysztof Hałasa" <khalasa@piap.pl>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: linux-kernel@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] net: move from strlcpy with unused retval to strscpy
Date: Tue, 23 Aug 2022 09:09:33 +0200	[thread overview]
Message-ID: <m34jy38mhe.fsf@t19.piap.pl> (raw)
In-Reply-To: <20220818210050.7108-1-wsa+renesas@sang-engineering.com> (Wolfram Sang's message of "Thu, 18 Aug 2022 23:00:34 +0200")

Wolfram Sang <wsa+renesas@sang-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@piap.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

  parent reply	other threads:[~2022-08-23  7:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220818210050.7108-1-wsa+renesas@sang-engineering.com>
2022-08-19  9:45 ` [PATCH] net: move from strlcpy with unused retval to strscpy Petr Machata
2022-08-23  7:09 ` Krzysztof Hałasa [this message]
2022-08-18 21:02 Wolfram Sang
2022-08-23  1:20 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m34jy38mhe.fsf@t19.piap.pl \
    --to=khalasa@piap.pl \
    --cc=davem@davemloft.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).