From: Bart Van Assche <bvanassche@acm.org>
To: Thorsten Blum <thorsten.blum@linux.dev>,
Don Brace <don.brace@microchip.com>,
"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-hardening@vger.kernel.org, Kees Cook <kees@kernel.org>,
David Laight <david.laight.linux@gmail.com>,
storagedev@microchip.com, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] scsi: hpsa: Remove deprecated and unnecessary strncpy()
Date: Tue, 18 Feb 2025 10:11:34 -0800 [thread overview]
Message-ID: <01bf49ea-8461-4961-bc9f-893ce59a3d2a@acm.org> (raw)
In-Reply-To: <20250214114302.86001-2-thorsten.blum@linux.dev>
On 2/14/25 3:43 AM, Thorsten Blum wrote:
> While replacing strncpy() with strscpy(), Bart Van Assche pointed out
> that the code occurs inside sysfs write callbacks, which already uses
> NUL-terminated strings. This allows the string to be passed directly to
> sscanf() without requiring a temporary copy.
>
> Remove the deprecated and unnecessary strncpy() and the corresponding
> local variables, and pass the buffer buf directly to sscanf().
>
> Replace sscanf() with kstrtoint() to silence checkpatch warnings.
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
next prev parent reply other threads:[~2025-02-18 18:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-14 11:43 [PATCH v3] scsi: hpsa: Remove deprecated and unnecessary strncpy() Thorsten Blum
2025-02-18 18:11 ` Bart Van Assche [this message]
2025-02-19 1:53 ` Martin K. Petersen
2025-02-25 0:32 ` Martin K. Petersen
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=01bf49ea-8461-4961-bc9f-893ce59a3d2a@acm.org \
--to=bvanassche@acm.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=david.laight.linux@gmail.com \
--cc=don.brace@microchip.com \
--cc=kees@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=storagedev@microchip.com \
--cc=thorsten.blum@linux.dev \
/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