From: Damien Le Moal <dlemoal@kernel.org>
To: Thorsten Blum <thorsten.blum@linux.dev>,
Jens Axboe <axboe@kernel.dk>, Chaitanya Kulkarni <kch@nvidia.com>,
Johannes Thumshirn <johannes.thumshirn@wdc.com>,
Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>,
Zhu Yanjun <yanjun.zhu@linux.dev>,
Zheng Qixing <zhengqixing@huawei.com>,
Yu Kuai <yukuai3@huawei.com>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] null_blk: Use strscpy() instead of strscpy_pad() in null_add_dev()
Date: Fri, 11 Apr 2025 09:01:31 +0900 [thread overview]
Message-ID: <228dd40d-29b6-4978-bf40-71c9c531f938@kernel.org> (raw)
In-Reply-To: <20250410154727.883207-1-thorsten.blum@linux.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@linux.dev>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2025-04-11 0:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-10 15:47 [PATCH] null_blk: Use strscpy() instead of strscpy_pad() in null_add_dev() Thorsten Blum
2025-04-10 16:11 ` Zhu Yanjun
2025-04-11 0:01 ` Damien Le Moal [this message]
2025-04-11 13:10 ` 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=228dd40d-29b6-4978-bf40-71c9c531f938@kernel.org \
--to=dlemoal@kernel.org \
--cc=axboe@kernel.dk \
--cc=johannes.thumshirn@wdc.com \
--cc=kch@nvidia.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shinichiro.kawasaki@wdc.com \
--cc=thorsten.blum@linux.dev \
--cc=yanjun.zhu@linux.dev \
--cc=yukuai3@huawei.com \
--cc=zhengqixing@huawei.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