Re: [PATCH] dmaengine: idxd: Replace memset(0) + strscpy() with strscpy_pad()
From: Thorsten Blum
Date: Mon Aug 11 2025 - 12:12:45 EST
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