[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <228dd40d-29b6-4978-bf40-71c9c531f938@kernel.org>
Date: Fri, 11 Apr 2025 09:01:31 +0900
From: Damien Le Moal <dlemoal@...nel.org>
To: Thorsten Blum <thorsten.blum@...ux.dev>, Jens Axboe <axboe@...nel.dk>,
Chaitanya Kulkarni <kch@...dia.com>,
Johannes Thumshirn <johannes.thumshirn@....com>,
Shin'ichiro Kawasaki <shinichiro.kawasaki@....com>,
Zhu Yanjun <yanjun.zhu@...ux.dev>, Zheng Qixing <zhengqixing@...wei.com>,
Yu Kuai <yukuai3@...wei.com>
Cc: linux-block@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] null_blk: Use strscpy() instead of strscpy_pad() in
null_add_dev()
On 4/11/25 00:47, Thorsten Blum wrote:
> blk_mq_alloc_disk() already zero-initializes the destination buffer,
> making strscpy() sufficient for safely copying the disk's name. The
> additional NUL-padding performed by strscpy_pad() is unnecessary.
>
> If the destination buffer has a fixed length, strscpy() automatically
> determines its size using sizeof() when the argument is omitted. This
> makes the explicit size argument unnecessary.
>
> The source string is also NUL-terminated and meets the __must_be_cstr()
> requirement of strscpy().
>
> No functional changes intended.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@...ux.dev>
Reviewed-by: Damien Le Moal <dlemoal@...nel.org>
--
Damien Le Moal
Western Digital Research
Powered by blists - more mailing lists