All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thorsten Blum <thorsten.blum@linux.dev>
To: Dave Jiang <dave.jiang@intel.com>
Cc: Vinicius Costa Gomes <vinicius.gomes@intel.com>,
	Vinod Koul <vkoul@kernel.org>,
	dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dmaengine: idxd: Replace memset(0) + strscpy() with strscpy_pad()
Date: Mon, 11 Aug 2025 17:57:55 +0200	[thread overview]
Message-ID: <C2F1E020-7F59-4545-814D-B05FBE2D7C22@linux.dev> (raw)
In-Reply-To: <5ecf9433-5de7-4e52-b246-bf17d0cea776@intel.com>

Hi Dave,

> On 11. Aug 2025, at 17:37, Dave Jiang wrote:
>> 	/* set name to "iaa_crypto" */
>> -	memset(wq->name, 0, WQ_NAME_SIZE + 1);
>> -	strscpy(wq->name, "iaa_crypto", WQ_NAME_SIZE + 1);
>> +	strscpy_pad(wq->name, "iaa_crypto");
> 
> Should also supply the max length?

The third argument of strscpy_pad() is optional when the destination
buffer has a fixed size. strscpy_pad() can then infer the size using
sizeof(), which equals 'WQ_NAME_SIZE + 1' and 'DRIVER_NAME_SIZE + 1',
respectively.

Thanks,
Thorsten


  reply	other threads:[~2025-08-11 15:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-10 22:58 [PATCH] dmaengine: idxd: Replace memset(0) + strscpy() with strscpy_pad() Thorsten Blum
2025-08-11 15:37 ` Dave Jiang
2025-08-11 15:57   ` Thorsten Blum [this message]
2025-08-11 16:02 ` Dave Jiang
2025-08-20 17:42 ` Vinod Koul

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=C2F1E020-7F59-4545-814D-B05FBE2D7C22@linux.dev \
    --to=thorsten.blum@linux.dev \
    --cc=dave.jiang@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vinicius.gomes@intel.com \
    --cc=vkoul@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.