Re: [PATCH] crypto: qat - use strscpy_pad to simplify adf_service_string_to_mask
From: Thomas Huth
Date: Mon Jul 06 2026 - 01:11:28 EST
On 05/07/2026 15.38, Thorsten Blum wrote:
Use strscpy_pad() to copy buf and zero-pad any trailing bytes instead ofReviewed-by: Thomas Huth <thuth@xxxxxxxxxx>
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(-)