You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ut...@apache.org on 2021/09/21 13:00:02 UTC
[mynewt-mcumgr] branch master updated: zephyr: Expand tabs to
spaces in img_mgmt source
This is an automated email from the ASF dual-hosted git repository.
utzig pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-mcumgr.git
The following commit(s) were added to refs/heads/master by this push:
new 57d2b1d zephyr: Expand tabs to spaces in img_mgmt source
57d2b1d is described below
commit 57d2b1d054f002ee6a15a33d77dfcec1a0e77f4e
Author: Dominik Ermel <do...@nordicsemi.no>
AuthorDate: Tue Sep 21 12:13:20 2021 +0000
zephyr: Expand tabs to spaces in img_mgmt source
Fixing code formatting.
Signed-off-by: Dominik Ermel <do...@nordicsemi.no>
---
cmd/img_mgmt/port/zephyr/src/zephyr_img_mgmt.c | 82 +++++++++++++-------------
1 file changed, 41 insertions(+), 41 deletions(-)
diff --git a/cmd/img_mgmt/port/zephyr/src/zephyr_img_mgmt.c b/cmd/img_mgmt/port/zephyr/src/zephyr_img_mgmt.c
index 533c006..b33ff92 100644
--- a/cmd/img_mgmt/port/zephyr/src/zephyr_img_mgmt.c
+++ b/cmd/img_mgmt/port/zephyr/src/zephyr_img_mgmt.c
@@ -370,50 +370,50 @@ int
img_mgmt_impl_write_image_data(unsigned int offset, const void *data,
unsigned int num_bytes, bool last)
{
- int rc = 0;
- static struct flash_img_context *ctx = NULL;
-
- if (CONFIG_HEAP_MEM_POOL_SIZE > 0 && offset != 0 && ctx == NULL) {
- return MGMT_ERR_EUNKNOWN;
- }
-
- if (offset == 0) {
- if (ctx == NULL) {
- ctx = alloc_ctx();
-
- if (ctx == NULL) {
- rc = MGMT_ERR_ENOMEM;
- goto out;
- }
- }
-
- rc = flash_img_init_id(ctx, g_img_mgmt_state.area_id);
-
- if (rc != 0) {
- rc = MGMT_ERR_EUNKNOWN;
- goto out;
- }
- }
-
- if (offset != ctx->stream.bytes_written + ctx->stream.buf_bytes) {
- rc = MGMT_ERR_EUNKNOWN;
- goto out;
- }
-
- /* Cast away const. */
- rc = flash_img_buffered_write(ctx, (void *)data, num_bytes, last);
- if (rc != 0) {
- rc = MGMT_ERR_EUNKNOWN;
- goto out;
- }
+ int rc = 0;
+ static struct flash_img_context *ctx = NULL;
+
+ if (CONFIG_HEAP_MEM_POOL_SIZE > 0 && offset != 0 && ctx == NULL) {
+ return MGMT_ERR_EUNKNOWN;
+ }
+
+ if (offset == 0) {
+ if (ctx == NULL) {
+ ctx = alloc_ctx();
+
+ if (ctx == NULL) {
+ rc = MGMT_ERR_ENOMEM;
+ goto out;
+ }
+ }
+
+ rc = flash_img_init_id(ctx, g_img_mgmt_state.area_id);
+
+ if (rc != 0) {
+ rc = MGMT_ERR_EUNKNOWN;
+ goto out;
+ }
+ }
+
+ if (offset != ctx->stream.bytes_written + ctx->stream.buf_bytes) {
+ rc = MGMT_ERR_EUNKNOWN;
+ goto out;
+ }
+
+ /* Cast away const. */
+ rc = flash_img_buffered_write(ctx, (void *)data, num_bytes, last);
+ if (rc != 0) {
+ rc = MGMT_ERR_EUNKNOWN;
+ goto out;
+ }
out:
- if (CONFIG_HEAP_MEM_POOL_SIZE > 0 && (last || rc != 0)) {
- k_free(ctx);
- ctx = NULL;
- }
+ if (CONFIG_HEAP_MEM_POOL_SIZE > 0 && (last || rc != 0)) {
+ k_free(ctx);
+ ctx = NULL;
+ }
- return rc;
+ return rc;
}
int