Distributed Replicated Block Device (DRBD) development
 help / color / mirror / Atom feed
From: Geoff Levand <geoff@infradead.org>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>,
	linux-kernel@vger.kernel.org
Cc: Jens Axboe <axboe@kernel.dk>, Minchan Kim <minchan@kernel.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	linuxppc-dev@lists.ozlabs.org,
	Philipp Reisner <philipp.reisner@linbit.com>,
	Jim Paris <jim@jtan.com>,
	linux-block@vger.kernel.org, Nicholas Piggin <npiggin@gmail.com>,
	Lars Ellenberg <lars.ellenberg@linbit.com>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Nitin Gupta <ngupta@vflare.org>,
	drbd-dev@lists.linbit.com
Subject: Re: [Drbd-dev] [PATCH] block: move from strlcpy with unused retval to strscpy
Date: Fri, 19 Aug 2022 08:21:56 -0700	[thread overview]
Message-ID: <66f8a3a6-22d5-8a1b-e011-c50de8e19e6c@infradead.org> (raw)
In-Reply-To: <20220818205958.6552-1-wsa+renesas@sang-engineering.com>

On 8/18/22 13:59, Wolfram Sang wrote:
> 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>
> ---
...
> diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c
> index e1d080f680ed..c76e0148eada 100644
> --- a/drivers/block/ps3vram.c
> +++ b/drivers/block/ps3vram.c
> @@ -745,7 +745,7 @@ static int ps3vram_probe(struct ps3_system_bus_device *dev)
>  	gendisk->flags |= GENHD_FL_NO_PART;
>  	gendisk->fops = &ps3vram_fops;
>  	gendisk->private_data = dev;
> -	strlcpy(gendisk->disk_name, DEVICE_NAME, sizeof(gendisk->disk_name));
> +	strscpy(gendisk->disk_name, DEVICE_NAME, sizeof(gendisk->disk_name));
>  	set_capacity(gendisk, priv->size >> 9);
>  	blk_queue_max_segments(gendisk->queue, BLK_MAX_SEGMENTS);
>  	blk_queue_max_segment_size(gendisk->queue, BLK_MAX_SEGMENT_SIZE);

Seems OK for ps3vram.

Acked-by: Geoff Levand <geoff@infradead.org>


  reply	other threads:[~2022-08-19 15:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-18 20:59 [Drbd-dev] [PATCH] block: move from strlcpy with unused retval to strscpy Wolfram Sang
2022-08-19 15:21 ` Geoff Levand [this message]
2022-08-19 15:24 ` Christoph Böhmwalder
2022-09-22  1:45 ` Jens Axboe

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=66f8a3a6-22d5-8a1b-e011-c50de8e19e6c@infradead.org \
    --to=geoff@infradead.org \
    --cc=axboe@kernel.dk \
    --cc=christophe.leroy@csgroup.eu \
    --cc=drbd-dev@lists.linbit.com \
    --cc=jim@jtan.com \
    --cc=lars.ellenberg@linbit.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=minchan@kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=ngupta@vflare.org \
    --cc=npiggin@gmail.com \
    --cc=philipp.reisner@linbit.com \
    --cc=senozhatsky@chromium.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