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:
1 parent
b2b24a9886
commit
79bbe453e5
1 file changed
+3
-4
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user