Re: [PATCH] crypto: qat - use strscpy_pad to simplify adf_service_string_to_mask

From: Herbert Xu

Date: Fri Jul 17 2026 - 04:18:34 EST


On Sun, Jul 05, 2026 at 03:38:39PM +0200, Thorsten Blum wrote:
> Use strscpy_pad() to copy buf and zero-pad any trailing bytes instead of
> zero-initializing the local services buffer and then using strscpy() to
> copy into it. Also use the strscpy_pad() return value to detect string
> truncation instead of checking the caller-provided length.
>
> Remove the now-unused length parameters from
> adf_service_string_to_mask() and adf_parse_service_string(). Also remove
> the redundant strnlen() call in adf_get_service_mask(), which only
> computed the removed length argument.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxx>
> ---
> .../intel/qat/qat_common/adf_cfg_services.c | 15 ++++++---------
> .../intel/qat/qat_common/adf_cfg_services.h | 2 +-
> drivers/crypto/intel/qat/qat_common/adf_sysfs.c | 2 +-
> 3 files changed, 8 insertions(+), 11 deletions(-)

Patch applied. Thanks.
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt