mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
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:
parent
b2b24a9886
commit
79bbe453e5
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user