astyle changes

pull/8730/head
Alexander Zilberkant 2018-11-18 10:10:02 +02:00
parent 53728e45b7
commit 9fa1f5a3d5
3 changed files with 18 additions and 15 deletions

View File

@ -35,7 +35,7 @@ psa_its_status_t test_psa_its_reset_impl(void)
psa_its_status_t status = PSA_ITS_SUCCESS;
int kv_status = kv_init_storage_config();
if(kv_status != MBED_SUCCESS) {
if (kv_status != MBED_SUCCESS) {
return PSA_ITS_ERROR_STORAGE_FAILURE;
}

View File

@ -21,8 +21,9 @@
#include "kv_config.h"
#include "mbed_error.h"
#define PSA_ITS_EMUL_PID 1 // In EMUL world, there is no real partitioning, which makes the source partition irrelevant.
// So here we set a global pid value to be used for when calling IMPL functions
// In EMUL world, there is no real partitioning, which makes the source partition irrelevant.
// So here we set a global pid value to be used for when calling IMPL functions
#define PSA_ITS_EMUL_PID 1
psa_its_status_t psa_its_set(uint32_t uid, uint32_t data_length, const void *p_data, psa_its_create_flags_t create_flags)
{
@ -34,7 +35,7 @@ psa_its_status_t psa_its_set(uint32_t uid, uint32_t data_length, const void *p_d
// - In EMUL (non-secure single core) we do it here since we don't have another context to do it inside.
// - Repeating calls has no effect
int kv_status = kv_init_storage_config();
if(kv_status != MBED_SUCCESS) {
if (kv_status != MBED_SUCCESS) {
return PSA_ITS_ERROR_STORAGE_FAILURE;
}
@ -53,7 +54,7 @@ psa_its_status_t psa_its_get(uint32_t uid, uint32_t data_offset, uint32_t data_l
// - In EMUL (non-secure single core) we do it here since we don't have another context to do it inside.
// - Repeating calls has no effect
int kv_status = kv_init_storage_config();
if(kv_status != MBED_SUCCESS) {
if (kv_status != MBED_SUCCESS) {
return PSA_ITS_ERROR_STORAGE_FAILURE;
}
@ -70,7 +71,7 @@ psa_its_status_t psa_its_get_info(uint32_t uid, struct psa_its_info_t *p_info)
// - In EMUL (non-secure single core) we do it here since we don't have another context to do it inside.
// - Repeating calls has no effect
int kv_status = kv_init_storage_config();
if(kv_status != MBED_SUCCESS) {
if (kv_status != MBED_SUCCESS) {
return PSA_ITS_ERROR_STORAGE_FAILURE;
}
@ -83,7 +84,7 @@ psa_its_status_t psa_its_remove(uint32_t uid)
// - In EMUL (non-secure single core) we do it here since we don't have another context to do it inside.
// - Repeating calls has no effect
int kv_status = kv_init_storage_config();
if(kv_status != MBED_SUCCESS) {
if (kv_status != MBED_SUCCESS) {
return PSA_ITS_ERROR_STORAGE_FAILURE;
}

View File

@ -29,8 +29,10 @@ extern "C"
using namespace mbed;
#define STR_EXPAND(tok) #tok
#define PSA_ITS_FILENAME_MAX_LEN 14 // Maximum length of filename we use for kvstore API.
// uid: 6; delimiter: 1; pid: 6; str terminator: 1
// Maximum length of filename we use for kvstore API.
// uid: 6; delimiter: 1; pid: 6; str terminator: 1
#define PSA_ITS_FILENAME_MAX_LEN 14
const uint8_t base64_coding_table[] = {
@ -91,7 +93,7 @@ psa_its_status_t psa_its_set_impl(uint32_t pid, uint32_t uid, uint32_t data_leng
error("psa_its_set_impl() - Failed getting kvstore instance\n");
}
if((create_flags != 0) && (create_flags != PSA_ITS_WRITE_ONCE_FLAG)) {
if ((create_flags != 0) && (create_flags != PSA_ITS_WRITE_ONCE_FLAG)) {
return PSA_ITS_ERROR_FLAGS_NOT_SUPPORTED;
}
@ -108,7 +110,7 @@ psa_its_status_t psa_its_set_impl(uint32_t pid, uint32_t uid, uint32_t data_leng
psa_its_status_t status = PSA_ITS_SUCCESS;
if (kvstore_status != MBED_SUCCESS) {
switch(kvstore_status) {
switch (kvstore_status) {
case MBED_ERROR_WRITE_PROTECTED:
status = PSA_ITS_ERROR_WRITE_ONCE;
break;
@ -139,7 +141,7 @@ psa_its_status_t psa_its_get_impl(uint32_t pid, uint32_t uid, uint32_t data_offs
psa_its_status_t status = PSA_ITS_SUCCESS;
if (kvstore_status != MBED_SUCCESS) {
switch(kvstore_status) {
switch (kvstore_status) {
case MBED_ERROR_ITEM_NOT_FOUND:
status = PSA_ITS_ERROR_KEY_NOT_FOUND;
break;
@ -170,7 +172,7 @@ psa_its_status_t psa_its_get_impl(uint32_t pid, uint32_t uid, uint32_t data_offs
status = PSA_ITS_ERROR_INCORRECT_SIZE;
}
} else {
switch(kvstore_status) {
switch (kvstore_status) {
case MBED_ERROR_ITEM_NOT_FOUND:
status = PSA_ITS_ERROR_KEY_NOT_FOUND;
break;
@ -199,7 +201,7 @@ psa_its_status_t psa_its_get_info_impl(uint32_t pid, uint32_t uid, struct psa_it
psa_its_status_t status = PSA_ITS_SUCCESS;
if (kvstore_status != MBED_SUCCESS) {
switch(kvstore_status) {
switch (kvstore_status) {
case MBED_ERROR_ITEM_NOT_FOUND:
status = PSA_ITS_ERROR_KEY_NOT_FOUND;
break;
@ -234,7 +236,7 @@ psa_its_status_t psa_its_remove_impl(uint32_t pid, uint32_t uid)
psa_its_status_t status = PSA_ITS_SUCCESS;
if (kvstore_status != MBED_SUCCESS) {
switch(kvstore_status) {
switch (kvstore_status) {
case MBED_ERROR_WRITE_PROTECTED:
status = PSA_ITS_ERROR_WRITE_ONCE;
break;