Skip to content

Commit

Permalink
mgmt: mcumgr: grp: Fix error translation function indent
Browse files Browse the repository at this point in the history
Fixes lines not being indented and looking like a single blob

Signed-off-by: Jamie McCrae <[email protected]>
  • Loading branch information
nordicjm authored and carlescufi committed Jul 31, 2023
1 parent dbea999 commit a0a9539
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 32 deletions.
12 changes: 6 additions & 6 deletions subsys/mgmt/mcumgr/grp/fs_mgmt/src/fs_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -911,13 +911,13 @@ static int fs_mgmt_translate_error_code(uint16_t ret)
switch (ret) {
case FS_MGMT_RET_RC_FILE_INVALID_NAME:
case FS_MGMT_RET_RC_CHECKSUM_HASH_NOT_FOUND:
rc = MGMT_ERR_EINVAL;
break;
rc = MGMT_ERR_EINVAL;
break;

case FS_MGMT_RET_RC_FILE_NOT_FOUND:
case FS_MGMT_RET_RC_FILE_IS_DIRECTORY:
rc = MGMT_ERR_ENOENT;
break;
rc = MGMT_ERR_ENOENT;
break;

case FS_MGMT_RET_RC_UNKNOWN:
case FS_MGMT_RET_RC_FILE_OPEN_FAILED:
Expand All @@ -928,8 +928,8 @@ static int fs_mgmt_translate_error_code(uint16_t ret)
case FS_MGMT_RET_RC_FILE_WRITE_FAILED:
case FS_MGMT_RET_RC_FILE_OFFSET_NOT_VALID:
case FS_MGMT_RET_RC_FILE_OFFSET_LARGER_THAN_FILE:
default:
rc = MGMT_ERR_EUNKNOWN;
default:
rc = MGMT_ERR_EUNKNOWN;
}

return rc;
Expand Down
20 changes: 10 additions & 10 deletions subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -775,18 +775,18 @@ static int img_mgmt_translate_error_code(uint16_t ret)
switch (ret) {
case IMG_MGMT_RET_RC_NO_IMAGE:
case IMG_MGMT_RET_RC_NO_TLVS:
rc = MGMT_ERR_ENOENT;
break;
rc = MGMT_ERR_ENOENT;
break;

case IMG_MGMT_RET_RC_NO_FREE_SLOT:
case IMG_MGMT_RET_RC_CURRENT_VERSION_IS_NEWER:
case IMG_MGMT_RET_RC_IMAGE_ALREADY_PENDING:
rc = MGMT_ERR_EBADSTATE;
break;
rc = MGMT_ERR_EBADSTATE;
break;

case IMG_MGMT_RET_RC_NO_FREE_MEMORY:
rc = MGMT_ERR_ENOMEM;
break;
rc = MGMT_ERR_ENOMEM;
break;

case IMG_MGMT_RET_RC_INVALID_SLOT:
case IMG_MGMT_RET_RC_INVALID_PAGE_OFFSET:
Expand All @@ -795,8 +795,8 @@ static int img_mgmt_translate_error_code(uint16_t ret)
case IMG_MGMT_RET_RC_INVALID_IMAGE_HEADER:
case IMG_MGMT_RET_RC_INVALID_HASH:
case IMG_MGMT_RET_RC_INVALID_FLASH_ADDRESS:
rc = MGMT_ERR_EINVAL;
break;
rc = MGMT_ERR_EINVAL;
break;

case IMG_MGMT_RET_RC_FLASH_CONFIG_QUERY_FAIL:
case IMG_MGMT_RET_RC_VERSION_GET_FAILED:
Expand All @@ -816,8 +816,8 @@ static int img_mgmt_translate_error_code(uint16_t ret)
case IMG_MGMT_RET_RC_INVALID_IMAGE_TOO_LARGE:
case IMG_MGMT_RET_RC_INVALID_IMAGE_DATA_OVERRUN:
case IMG_MGMT_RET_RC_UNKNOWN:
default:
rc = MGMT_ERR_EUNKNOWN;
default:
rc = MGMT_ERR_EUNKNOWN;
}

return rc;
Expand Down
6 changes: 3 additions & 3 deletions subsys/mgmt/mcumgr/grp/os_mgmt/src/os_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,12 +688,12 @@ static int os_mgmt_translate_error_code(uint16_t ret)

switch (ret) {
case OS_MGMT_RET_RC_INVALID_FORMAT:
rc = MGMT_ERR_EINVAL;
break;
rc = MGMT_ERR_EINVAL;
break;

case OS_MGMT_RET_RC_UNKNOWN:
default:
rc = MGMT_ERR_EUNKNOWN;
rc = MGMT_ERR_EUNKNOWN;
}

return rc;
Expand Down
6 changes: 3 additions & 3 deletions subsys/mgmt/mcumgr/grp/shell_mgmt/src/shell_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ static int shell_mgmt_translate_error_code(uint16_t ret)
switch (ret) {
case SHELL_MGMT_RET_RC_COMMAND_TOO_LONG:
case SHELL_MGMT_RET_RC_EMPTY_COMMAND:
rc = MGMT_ERR_EINVAL;
break;
rc = MGMT_ERR_EINVAL;
break;

default:
rc = MGMT_ERR_EUNKNOWN;
rc = MGMT_ERR_EUNKNOWN;
}

return rc;
Expand Down
10 changes: 5 additions & 5 deletions subsys/mgmt/mcumgr/grp/stat_mgmt/src/stat_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,16 +254,16 @@ static int stat_mgmt_translate_error_code(uint16_t ret)
switch (ret) {
case STAT_MGMT_RET_RC_INVALID_GROUP:
case STAT_MGMT_RET_RC_INVALID_STAT_NAME:
rc = MGMT_ERR_ENOENT;
break;
rc = MGMT_ERR_ENOENT;
break;

case STAT_MGMT_RET_RC_INVALID_STAT_SIZE:
rc = MGMT_ERR_EINVAL;
break;
rc = MGMT_ERR_EINVAL;
break;

case STAT_MGMT_RET_RC_WALK_ABORTED:
default:
rc = MGMT_ERR_EUNKNOWN;
rc = MGMT_ERR_EUNKNOWN;
}

return rc;
Expand Down
10 changes: 5 additions & 5 deletions subsys/mgmt/mcumgr/grp/zephyr_basic/src/basic_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,16 @@ static int zephyr_basic_group_translate_error_code(uint16_t ret)

switch (ret) {
case ZEPHYR_MGMT_GRP_CMD_RC_FLASH_OPEN_FAILED:
rc = MGMT_ERR_ENOENT;
break;
rc = MGMT_ERR_ENOENT;
break;

case ZEPHYR_MGMT_GRP_CMD_RC_FLASH_CONFIG_QUERY_FAIL:
case ZEPHYR_MGMT_GRP_CMD_RC_FLASH_ERASE_FAILED:
rc = MGMT_ERR_EOK;
break;
rc = MGMT_ERR_EOK;
break;

default:
rc = MGMT_ERR_EUNKNOWN;
rc = MGMT_ERR_EUNKNOWN;
}

return rc;
Expand Down

0 comments on commit a0a9539

Please sign in to comment.