crypto: qat - simplify adf_service_mask_to_string helper

Use a single scnprintf() for each set bit and drop the offset in the
else branch to simplify adf_service_mask_to_string().

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Acked-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Thorsten Blum 2026-05-27 19:46:55 +02:00 committed by Herbert Xu
parent b2b24a9886
commit 79bbe453e5

View File

@ -94,10 +94,9 @@ static int adf_service_mask_to_string(unsigned long mask, char *buf, size_t len)
for_each_set_bit(bit, &mask, SVC_COUNT) {
if (offset)
offset += scnprintf(buf + offset, len - offset,
ADF_SERVICES_DELIMITER);
offset += scnprintf(buf + offset, len - offset, "%s",
adf_cfg_services[bit]);
ADF_SERVICES_DELIMITER "%s", adf_cfg_services[bit]);
else
offset += scnprintf(buf, len, "%s", adf_cfg_services[bit]);
}
return 0;