Skip to content

Commit 15361d2

Browse files
tomi-fontjukkar
authored andcommitted
[nrf fromlist] secure_storage: use %# flag character for hex printing
Instead of literally having 0x in the format string, use the %# flag character so the printf implementation adds the 0x for us. Signed-off-by: Tomi Fontanilles <[email protected]> Upstream PR #: 94171 (cherry picked from commit fdb9ab5)
1 parent 2829b9c commit 15361d2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

subsys/secure_storage/src/its/implementation.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static psa_status_t make_its_uid(secure_storage_its_caller_id_t caller_id, psa_s
2727
#ifndef CONFIG_SECURE_STORAGE_64_BIT_UID
2828
/* Check that the UID is not bigger than the maximum defined size. */
2929
if (uid & GENMASK64(63, SECURE_STORAGE_ITS_UID_BIT_SIZE)) {
30-
LOG_DBG("UID %u/0x%llx cannot be used as it has bits set past "
30+
LOG_DBG("UID %u/%#llx cannot be used as it has bits set past "
3131
"the first " STRINGIFY(SECURE_STORAGE_ITS_UID_BIT_SIZE) " ones.",
3232
caller_id, (unsigned long long)uid);
3333
return PSA_ERROR_INVALID_ARGUMENT;

subsys/secure_storage/src/its/store/zms.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ psa_status_t secure_storage_its_store_set(secure_storage_its_uid_t uid,
6969
} else {
7070
psa_ret = PSA_ERROR_STORAGE_FAILURE;
7171
}
72-
LOG_DBG("%s 0x%x with %zu bytes. (%zd)", (psa_ret == PSA_SUCCESS) ?
72+
LOG_DBG("%s %#x with %zu bytes. (%zd)", (psa_ret == PSA_SUCCESS) ?
7373
"Wrote" : "Failed to write", zms_id, data_length, zms_ret);
7474
return psa_ret;
7575
}
@@ -90,7 +90,7 @@ psa_status_t secure_storage_its_store_get(secure_storage_its_uid_t uid, size_t d
9090
} else {
9191
psa_ret = PSA_ERROR_STORAGE_FAILURE;
9292
}
93-
LOG_DBG("%s 0x%x for up to %zu bytes. (%zd)", (psa_ret != PSA_ERROR_STORAGE_FAILURE) ?
93+
LOG_DBG("%s %#x for up to %zu bytes. (%zd)", (psa_ret != PSA_ERROR_STORAGE_FAILURE) ?
9494
"Read" : "Failed to read", zms_id, data_size, zms_ret);
9595
return psa_ret;
9696
}
@@ -101,7 +101,7 @@ psa_status_t secure_storage_its_store_remove(secure_storage_its_uid_t uid)
101101
const uint32_t zms_id = zms_id_from(uid);
102102

103103
ret = zms_delete(&s_zms, zms_id);
104-
LOG_DBG("%s 0x%x. (%d)", ret ? "Failed to delete" : "Deleted", zms_id, ret);
104+
LOG_DBG("%s %#x. (%d)", ret ? "Failed to delete" : "Deleted", zms_id, ret);
105105

106106
return ret ? PSA_ERROR_STORAGE_FAILURE : PSA_SUCCESS;
107107
}

0 commit comments

Comments
 (0)