[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <C2F1E020-7F59-4545-814D-B05FBE2D7C22@linux.dev>
Date: Mon, 11 Aug 2025 17:57:55 +0200
From: Thorsten Blum <thorsten.blum@...ux.dev>
To: Dave Jiang <dave.jiang@...el.com>
Cc: Vinicius Costa Gomes <vinicius.gomes@...el.com>,
Vinod Koul <vkoul@...nel.org>,
dmaengine@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] dmaengine: idxd: Replace memset(0) + strscpy() with
strscpy_pad()
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
Powered by blists - more mailing lists