Merge pull request #33 from d3zd3z/zepspace

Make zephyr code comply with indentation of rest of mcuboot
diff --git a/boot/zephyr/flash_map.c b/boot/zephyr/flash_map.c
index edb02ed..fca3724 100644
--- a/boot/zephyr/flash_map.c
+++ b/boot/zephyr/flash_map.c
@@ -36,21 +36,21 @@
  * flash.  In this case, it starts with FLASH_AREA_IMAGE_0.
  */
 static const struct flash_area part_map[] = {
-	{
-		.fa_id = FLASH_AREA_IMAGE_0,
-		.fa_off = FLASH_AREA_IMAGE_0_OFFSET,
-		.fa_size = FLASH_AREA_IMAGE_0_SIZE,
-	},
-	{
-		.fa_id = FLASH_AREA_IMAGE_1,
-		.fa_off = FLASH_AREA_IMAGE_1_OFFSET,
-		.fa_size = FLASH_AREA_IMAGE_1_SIZE,
-	},
-	{
-		.fa_id = FLASH_AREA_IMAGE_SCRATCH,
-		.fa_off = FLASH_AREA_IMAGE_SCRATCH_OFFSET,
-		.fa_size = FLASH_AREA_IMAGE_SCRATCH_SIZE,
-	},
+    {
+        .fa_id = FLASH_AREA_IMAGE_0,
+        .fa_off = FLASH_AREA_IMAGE_0_OFFSET,
+        .fa_size = FLASH_AREA_IMAGE_0_SIZE,
+    },
+    {
+        .fa_id = FLASH_AREA_IMAGE_1,
+        .fa_off = FLASH_AREA_IMAGE_1_OFFSET,
+        .fa_size = FLASH_AREA_IMAGE_1_SIZE,
+    },
+    {
+        .fa_id = FLASH_AREA_IMAGE_SCRATCH,
+        .fa_off = FLASH_AREA_IMAGE_SCRATCH_OFFSET,
+        .fa_size = FLASH_AREA_IMAGE_SCRATCH_SIZE,
+    },
 };
 
 /*
@@ -59,19 +59,21 @@
  */
 int flash_area_open(uint8_t id, const struct flash_area **area)
 {
-	int i;
+    int i;
 
-	BOOT_LOG_DBG("area %d", id);
+    BOOT_LOG_DBG("area %d", id);
 
-	for (i = 0; i < ARRAY_SIZE(part_map); i++) {
-		if (id == part_map[i].fa_id)
-			break;
-	}
-	if (i == ARRAY_SIZE(part_map))
-		return -1;
+    for (i = 0; i < ARRAY_SIZE(part_map); i++) {
+        if (id == part_map[i].fa_id) {
+            break;
+        }
+    }
+    if (i == ARRAY_SIZE(part_map)) {
+        return -1;
+    }
 
-	*area = &part_map[i];
-	return 0;
+    *area = &part_map[i];
+    return 0;
 }
 
 /*
@@ -82,38 +84,38 @@
 }
 
 int flash_area_read(const struct flash_area *area, uint32_t off, void *dst,
-		    uint32_t len)
+            uint32_t len)
 {
-	BOOT_LOG_DBG("area=%d, off=%x, len=%x", area->fa_id, off, len);
-	return flash_read(boot_flash_device, area->fa_off + off, dst, len);
+    BOOT_LOG_DBG("area=%d, off=%x, len=%x", area->fa_id, off, len);
+    return flash_read(boot_flash_device, area->fa_off + off, dst, len);
 }
 
 int flash_area_write(const struct flash_area *area, uint32_t off, const void *src,
-		     uint32_t len)
+             uint32_t len)
 {
-	int rc = 0;
+    int rc = 0;
 
-	BOOT_LOG_DBG("area=%d, off=%x, len=%x", area->fa_id, off, len);
-	flash_write_protection_set(boot_flash_device, false);
-	rc = flash_write(boot_flash_device, area->fa_off + off, src, len);
-	flash_write_protection_set(boot_flash_device, true);
-	return rc;
+    BOOT_LOG_DBG("area=%d, off=%x, len=%x", area->fa_id, off, len);
+    flash_write_protection_set(boot_flash_device, false);
+    rc = flash_write(boot_flash_device, area->fa_off + off, src, len);
+    flash_write_protection_set(boot_flash_device, true);
+    return rc;
 }
 
 int flash_area_erase(const struct flash_area *area, uint32_t off, uint32_t len)
 {
-	int rc;
+    int rc;
 
-	BOOT_LOG_DBG("area=%d, off=%x, len=%x", area->fa_id, off, len);
-	flash_write_protection_set(boot_flash_device, false);
-	rc = flash_erase(boot_flash_device, area->fa_off + off, len);
-	flash_write_protection_set(boot_flash_device, true);
-	return rc;
+    BOOT_LOG_DBG("area=%d, off=%x, len=%x", area->fa_id, off, len);
+    flash_write_protection_set(boot_flash_device, false);
+    rc = flash_erase(boot_flash_device, area->fa_off + off, len);
+    flash_write_protection_set(boot_flash_device, true);
+    return rc;
 }
 
 uint8_t flash_area_align(const struct flash_area *area)
 {
-	return hal_flash_align(area->fa_id);
+    return hal_flash_align(area->fa_id);
 }
 
 /*
@@ -122,7 +124,7 @@
  */
 int flash_area_id_from_image_slot(int slot)
 {
-	return slot + FLASH_AREA_IMAGE_0;
+    return slot + FLASH_AREA_IMAGE_0;
 }
 
 #ifndef FLASH_AREA_IMAGE_SECTOR_SIZE
@@ -138,64 +140,66 @@
  */
 int flash_area_to_sectors(int idx, int *cnt, struct flash_area *ret)
 {
-	uint32_t off;
-	uint32_t len;
-	uint32_t max_cnt = *cnt;
-	uint32_t rem_len;
+    uint32_t off;
+    uint32_t len;
+    uint32_t max_cnt = *cnt;
+    uint32_t rem_len;
 
-	/*
-	 * This simple layout has uniform slots, so just fill in the
-	 * right one.
-	 */
-	if (idx < FLASH_AREA_IMAGE_0 || idx > FLASH_AREA_IMAGE_SCRATCH)
-		return -1;
+    /*
+     * This simple layout has uniform slots, so just fill in the
+     * right one.
+     */
+    if (idx < FLASH_AREA_IMAGE_0 || idx > FLASH_AREA_IMAGE_SCRATCH) {
+        return -1;
+    }
 
-	if (*cnt < 1)
-		return -1;
+    if (*cnt < 1) {
+        return -1;
+    }
 
-	switch (idx) {
-	case FLASH_AREA_IMAGE_0:
-		off = FLASH_AREA_IMAGE_0_OFFSET;
-		len = FLASH_AREA_IMAGE_0_SIZE;
-		break;
-	case FLASH_AREA_IMAGE_1:
-		off = FLASH_AREA_IMAGE_1_OFFSET;
-		len = FLASH_AREA_IMAGE_1_SIZE;
-		break;
-	case FLASH_AREA_IMAGE_SCRATCH:
-		off = FLASH_AREA_IMAGE_SCRATCH_OFFSET;
-		len = FLASH_AREA_IMAGE_SCRATCH_SIZE;
-		break;
-	default:
-		BOOT_LOG_ERR("unknown flash area %d", idx);
-		return -1;
-	}
+    switch (idx) {
+    case FLASH_AREA_IMAGE_0:
+        off = FLASH_AREA_IMAGE_0_OFFSET;
+        len = FLASH_AREA_IMAGE_0_SIZE;
+        break;
+    case FLASH_AREA_IMAGE_1:
+        off = FLASH_AREA_IMAGE_1_OFFSET;
+        len = FLASH_AREA_IMAGE_1_SIZE;
+        break;
+    case FLASH_AREA_IMAGE_SCRATCH:
+        off = FLASH_AREA_IMAGE_SCRATCH_OFFSET;
+        len = FLASH_AREA_IMAGE_SCRATCH_SIZE;
+        break;
+    default:
+        BOOT_LOG_ERR("unknown flash area %d", idx);
+        return -1;
+    }
 
-	BOOT_LOG_DBG("area %d: offset=0x%x, length=0x%x, sector size=0x%x",
-		     idx, off, len, FLASH_AREA_IMAGE_SECTOR_SIZE);
+    BOOT_LOG_DBG("area %d: offset=0x%x, length=0x%x, sector size=0x%x",
+             idx, off, len, FLASH_AREA_IMAGE_SECTOR_SIZE);
 
-	rem_len = len;
-	*cnt = 0;
-	while (rem_len > 0 && *cnt < max_cnt) {
-		if (rem_len < FLASH_AREA_IMAGE_SECTOR_SIZE) {
-			BOOT_LOG_ERR("area %d size 0x%x not divisible by sector size 0x%x",
-				     idx, len, FLASH_AREA_IMAGE_SECTOR_SIZE);
-			return -1;
-		}
+    rem_len = len;
+    *cnt = 0;
+    while (rem_len > 0 && *cnt < max_cnt) {
+        if (rem_len < FLASH_AREA_IMAGE_SECTOR_SIZE) {
+            BOOT_LOG_ERR("area %d size 0x%x not divisible by sector size 0x%x",
+                     idx, len, FLASH_AREA_IMAGE_SECTOR_SIZE);
+            return -1;
+        }
 
-		ret[*cnt].fa_id = idx;
-		ret[*cnt].fa_device_id = 0;
-		ret[*cnt].pad16 = 0;
-		ret[*cnt].fa_off = off + (FLASH_AREA_IMAGE_SECTOR_SIZE * (*cnt));
-		ret[*cnt].fa_size = FLASH_AREA_IMAGE_SECTOR_SIZE;
-		*cnt = *cnt + 1;
-		rem_len -= FLASH_AREA_IMAGE_SECTOR_SIZE;
-	}
+        ret[*cnt].fa_id = idx;
+        ret[*cnt].fa_device_id = 0;
+        ret[*cnt].pad16 = 0;
+        ret[*cnt].fa_off = off + (FLASH_AREA_IMAGE_SECTOR_SIZE * (*cnt));
+        ret[*cnt].fa_size = FLASH_AREA_IMAGE_SECTOR_SIZE;
+        *cnt = *cnt + 1;
+        rem_len -= FLASH_AREA_IMAGE_SECTOR_SIZE;
+    }
 
-	if (*cnt >= max_cnt) {
-		BOOT_LOG_ERR("flash area %d sector count overflow", idx);
-		return -1;
-	}
+    if (*cnt >= max_cnt) {
+        BOOT_LOG_ERR("flash area %d sector count overflow", idx);
+        return -1;
+    }
 
-	return 0;
+    return 0;
 }
diff --git a/boot/zephyr/hal_flash.c b/boot/zephyr/hal_flash.c
index 552f767..17b6124 100644
--- a/boot/zephyr/hal_flash.c
+++ b/boot/zephyr/hal_flash.c
@@ -25,5 +25,5 @@
 
 uint8_t hal_flash_align(uint8_t flash_id)
 {
-	return FLASH_ALIGN;
+    return FLASH_ALIGN;
 }
diff --git a/boot/zephyr/keys.c b/boot/zephyr/keys.c
index 9a06f3c..9d2f36b 100644
--- a/boot/zephyr/keys.c
+++ b/boot/zephyr/keys.c
@@ -21,54 +21,54 @@
 
 #if defined(BOOTUTIL_SIGN_RSA)
 const unsigned char root_pub_der[] = {
-  0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xd1, 0x06, 0x08,
-  0x1a, 0x18, 0x44, 0x2c, 0x18, 0xe8, 0xfb, 0xfd, 0xf7, 0x0d, 0xa3, 0x4f,
-  0x1f, 0xbb, 0xee, 0x5e, 0xf9, 0xaa, 0xd2, 0x4b, 0x18, 0xd3, 0x5a, 0xe9,
-  0x6d, 0x18, 0x80, 0x19, 0xf9, 0xf0, 0x9c, 0x34, 0x1b, 0xcb, 0xf3, 0xbc,
-  0x74, 0xdb, 0x42, 0xe7, 0x8c, 0x7f, 0x10, 0x53, 0x7e, 0x43, 0x5e, 0x0d,
-  0x57, 0x2c, 0x44, 0xd1, 0x67, 0x08, 0x0f, 0x0d, 0xbb, 0x5c, 0xee, 0xec,
-  0xb3, 0x99, 0xdf, 0xe0, 0x4d, 0x84, 0x0b, 0xaa, 0x77, 0x41, 0x60, 0xed,
-  0x15, 0x28, 0x49, 0xa7, 0x01, 0xb4, 0x3c, 0x10, 0xe6, 0x69, 0x8c, 0x2f,
-  0x5f, 0xac, 0x41, 0x4d, 0x9e, 0x5c, 0x14, 0xdf, 0xf2, 0xf8, 0xcf, 0x3d,
-  0x1e, 0x6f, 0xe7, 0x5b, 0xba, 0xb4, 0xa9, 0xc8, 0x88, 0x7e, 0x47, 0x3c,
-  0x94, 0xc3, 0x77, 0x67, 0x54, 0x4b, 0xaa, 0x8d, 0x38, 0x35, 0xca, 0x62,
-  0x61, 0x7e, 0xb7, 0xe1, 0x15, 0xdb, 0x77, 0x73, 0xd4, 0xbe, 0x7b, 0x72,
-  0x21, 0x89, 0x69, 0x24, 0xfb, 0xf8, 0x65, 0x6e, 0x64, 0x3e, 0xc8, 0x0e,
-  0xd7, 0x85, 0xd5, 0x5c, 0x4a, 0xe4, 0x53, 0x0d, 0x2f, 0xff, 0xb7, 0xfd,
-  0xf3, 0x13, 0x39, 0x83, 0x3f, 0xa3, 0xae, 0xd2, 0x0f, 0xa7, 0x6a, 0x9d,
-  0xf9, 0xfe, 0xb8, 0xce, 0xfa, 0x2a, 0xbe, 0xaf, 0xb8, 0xe0, 0xfa, 0x82,
-  0x37, 0x54, 0xf4, 0x3e, 0xe1, 0x2b, 0xd0, 0xd3, 0x08, 0x58, 0x18, 0xf6,
-  0x5e, 0x4c, 0xc8, 0x88, 0x81, 0x31, 0xad, 0x5f, 0xb0, 0x82, 0x17, 0xf2,
-  0x8a, 0x69, 0x27, 0x23, 0xf3, 0xab, 0x87, 0x3e, 0x93, 0x1a, 0x1d, 0xfe,
-  0xe8, 0xf8, 0x1a, 0x24, 0x66, 0x59, 0xf8, 0x1c, 0xab, 0xdc, 0xce, 0x68,
-  0x1b, 0x66, 0x64, 0x35, 0xec, 0xfa, 0x0d, 0x11, 0x9d, 0xaf, 0x5c, 0x3a,
-  0xa7, 0xd1, 0x67, 0xc6, 0x47, 0xef, 0xb1, 0x4b, 0x2c, 0x62, 0xe1, 0xd1,
-  0xc9, 0x02, 0x03, 0x01, 0x00, 0x01
+    0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xd1, 0x06, 0x08,
+    0x1a, 0x18, 0x44, 0x2c, 0x18, 0xe8, 0xfb, 0xfd, 0xf7, 0x0d, 0xa3, 0x4f,
+    0x1f, 0xbb, 0xee, 0x5e, 0xf9, 0xaa, 0xd2, 0x4b, 0x18, 0xd3, 0x5a, 0xe9,
+    0x6d, 0x18, 0x80, 0x19, 0xf9, 0xf0, 0x9c, 0x34, 0x1b, 0xcb, 0xf3, 0xbc,
+    0x74, 0xdb, 0x42, 0xe7, 0x8c, 0x7f, 0x10, 0x53, 0x7e, 0x43, 0x5e, 0x0d,
+    0x57, 0x2c, 0x44, 0xd1, 0x67, 0x08, 0x0f, 0x0d, 0xbb, 0x5c, 0xee, 0xec,
+    0xb3, 0x99, 0xdf, 0xe0, 0x4d, 0x84, 0x0b, 0xaa, 0x77, 0x41, 0x60, 0xed,
+    0x15, 0x28, 0x49, 0xa7, 0x01, 0xb4, 0x3c, 0x10, 0xe6, 0x69, 0x8c, 0x2f,
+    0x5f, 0xac, 0x41, 0x4d, 0x9e, 0x5c, 0x14, 0xdf, 0xf2, 0xf8, 0xcf, 0x3d,
+    0x1e, 0x6f, 0xe7, 0x5b, 0xba, 0xb4, 0xa9, 0xc8, 0x88, 0x7e, 0x47, 0x3c,
+    0x94, 0xc3, 0x77, 0x67, 0x54, 0x4b, 0xaa, 0x8d, 0x38, 0x35, 0xca, 0x62,
+    0x61, 0x7e, 0xb7, 0xe1, 0x15, 0xdb, 0x77, 0x73, 0xd4, 0xbe, 0x7b, 0x72,
+    0x21, 0x89, 0x69, 0x24, 0xfb, 0xf8, 0x65, 0x6e, 0x64, 0x3e, 0xc8, 0x0e,
+    0xd7, 0x85, 0xd5, 0x5c, 0x4a, 0xe4, 0x53, 0x0d, 0x2f, 0xff, 0xb7, 0xfd,
+    0xf3, 0x13, 0x39, 0x83, 0x3f, 0xa3, 0xae, 0xd2, 0x0f, 0xa7, 0x6a, 0x9d,
+    0xf9, 0xfe, 0xb8, 0xce, 0xfa, 0x2a, 0xbe, 0xaf, 0xb8, 0xe0, 0xfa, 0x82,
+    0x37, 0x54, 0xf4, 0x3e, 0xe1, 0x2b, 0xd0, 0xd3, 0x08, 0x58, 0x18, 0xf6,
+    0x5e, 0x4c, 0xc8, 0x88, 0x81, 0x31, 0xad, 0x5f, 0xb0, 0x82, 0x17, 0xf2,
+    0x8a, 0x69, 0x27, 0x23, 0xf3, 0xab, 0x87, 0x3e, 0x93, 0x1a, 0x1d, 0xfe,
+    0xe8, 0xf8, 0x1a, 0x24, 0x66, 0x59, 0xf8, 0x1c, 0xab, 0xdc, 0xce, 0x68,
+    0x1b, 0x66, 0x64, 0x35, 0xec, 0xfa, 0x0d, 0x11, 0x9d, 0xaf, 0x5c, 0x3a,
+    0xa7, 0xd1, 0x67, 0xc6, 0x47, 0xef, 0xb1, 0x4b, 0x2c, 0x62, 0xe1, 0xd1,
+    0xc9, 0x02, 0x03, 0x01, 0x00, 0x01
 };
 const unsigned int root_pub_der_len = 270;
 #elif defined(BOOTUTIL_SIGN_EC256)
 const unsigned char root_pub_der[] = {
-	0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86,
-	0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a,
-	0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03,
-	0x42, 0x00, 0x04, 0x2a, 0xcb, 0x40, 0x3c, 0xe8,
-	0xfe, 0xed, 0x5b, 0xa4, 0x49, 0x95, 0xa1, 0xa9,
-	0x1d, 0xae, 0xe8, 0xdb, 0xbe, 0x19, 0x37, 0xcd,
-	0x14, 0xfb, 0x2f, 0x24, 0x57, 0x37, 0xe5, 0x95,
-	0x39, 0x88, 0xd9, 0x94, 0xb9, 0xd6, 0x5a, 0xeb,
-	0xd7, 0xcd, 0xd5, 0x30, 0x8a, 0xd6, 0xfe, 0x48,
-	0xb2, 0x4a, 0x6a, 0x81, 0x0e, 0xe5, 0xf0, 0x7d,
-	0x8b, 0x68, 0x34, 0xcc, 0x3a, 0x6a, 0xfc, 0x53,
-	0x8e, 0xfa, 0xc1, };
+    0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86,
+    0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a,
+    0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03,
+    0x42, 0x00, 0x04, 0x2a, 0xcb, 0x40, 0x3c, 0xe8,
+    0xfe, 0xed, 0x5b, 0xa4, 0x49, 0x95, 0xa1, 0xa9,
+    0x1d, 0xae, 0xe8, 0xdb, 0xbe, 0x19, 0x37, 0xcd,
+    0x14, 0xfb, 0x2f, 0x24, 0x57, 0x37, 0xe5, 0x95,
+    0x39, 0x88, 0xd9, 0x94, 0xb9, 0xd6, 0x5a, 0xeb,
+    0xd7, 0xcd, 0xd5, 0x30, 0x8a, 0xd6, 0xfe, 0x48,
+    0xb2, 0x4a, 0x6a, 0x81, 0x0e, 0xe5, 0xf0, 0x7d,
+    0x8b, 0x68, 0x34, 0xcc, 0x3a, 0x6a, 0xfc, 0x53,
+    0x8e, 0xfa, 0xc1, };
 const unsigned int root_pub_der_len = 91;
 #else
 #error "No public key available for given signing algorithm."
 #endif
 
 const struct bootutil_key bootutil_keys[] = {
-	{
-		.key = root_pub_der,
-		.len = &root_pub_der_len,
-	},
+    {
+        .key = root_pub_der,
+        .len = &root_pub_der_len,
+    },
 };
 const int bootutil_key_cnt = 1;
diff --git a/boot/zephyr/main.c b/boot/zephyr/main.c
index f037a2b..9791f26 100644
--- a/boot/zephyr/main.c
+++ b/boot/zephyr/main.c
@@ -32,25 +32,25 @@
 
 #if defined(CONFIG_ARM)
 struct arm_vector_table {
-	uint32_t msp;
-	uint32_t reset;
+    uint32_t msp;
+    uint32_t reset;
 };
 
 static void do_boot(struct boot_rsp *rsp)
 {
-	struct arm_vector_table *vt;
+    struct arm_vector_table *vt;
 
-	/* The beginning of the image is the ARM vector table, containing
-	 * the initial stack pointer address and the reset vector
-	 * consecutively. Manually set the stack pointer and jump into the
-	 * reset vector
-	 */
-	vt = (struct arm_vector_table *)(rsp->br_image_addr +
-					 rsp->br_hdr->ih_hdr_size);
-	irq_lock();
-	sys_clock_disable();
-	_MspSet(vt->msp);
-	((void (*)(void))vt->reset)();
+    /* The beginning of the image is the ARM vector table, containing
+     * the initial stack pointer address and the reset vector
+     * consecutively. Manually set the stack pointer and jump into the
+     * reset vector
+     */
+    vt = (struct arm_vector_table *)(rsp->br_image_addr +
+                                     rsp->br_hdr->ih_hdr_size);
+    irq_lock();
+    sys_clock_disable();
+    _MspSet(vt->msp);
+    ((void (*)(void))vt->reset)();
 }
 #else
 /* Default: Assume entry point is at the very beginning of the image. Simply
@@ -59,44 +59,44 @@
  */
 static void do_boot(struct boot_rsp *rsp)
 {
-	void *start;
+    void *start;
 
-	start = (void *)(rsp->br_image_addr + rsp->br_hdr->ih_hdr_size);
+    start = (void *)(rsp->br_image_addr + rsp->br_hdr->ih_hdr_size);
 
-	/* Lock interrupts and dive into the entry point */
-	irq_lock();
-	((void (*)(void))start)();
+    /* Lock interrupts and dive into the entry point */
+    irq_lock();
+    ((void (*)(void))start)();
 }
 #endif
 
 void main(void)
 {
-	struct boot_rsp rsp;
-	int rc;
+    struct boot_rsp rsp;
+    int rc;
 
-	BOOT_LOG_INF("Starting bootloader");
+    BOOT_LOG_INF("Starting bootloader");
 
-	os_heap_init();
+    os_heap_init();
 
-	boot_flash_device = device_get_binding(FLASH_DRIVER_NAME);
-	if (!boot_flash_device) {
-		BOOT_LOG_ERR("Flash device not found");
-		while (1)
-			;
-	}
+    boot_flash_device = device_get_binding(FLASH_DRIVER_NAME);
+    if (!boot_flash_device) {
+        BOOT_LOG_ERR("Flash device not found");
+        while (1)
+            ;
+    }
 
-	rc = boot_go(&rsp);
-	if (rc != 0) {
-		BOOT_LOG_ERR("Unable to find bootable image");
-		while (1)
-			;
-	}
+    rc = boot_go(&rsp);
+    if (rc != 0) {
+        BOOT_LOG_ERR("Unable to find bootable image");
+        while (1)
+            ;
+    }
 
-	BOOT_LOG_INF("Bootloader chainload address: 0x%x", rsp.br_image_addr);
-	BOOT_LOG_INF("Jumping to the first image slot");
-	do_boot(&rsp);
+    BOOT_LOG_INF("Bootloader chainload address: 0x%x", rsp.br_image_addr);
+    BOOT_LOG_INF("Jumping to the first image slot");
+    do_boot(&rsp);
 
-	BOOT_LOG_ERR("Never should get here");
-	while (1)
-		;
+    BOOT_LOG_ERR("Never should get here");
+    while (1)
+        ;
 }
diff --git a/boot/zephyr/os.c b/boot/zephyr/os.c
index e73edaa..0a5abbd 100644
--- a/boot/zephyr/os.c
+++ b/boot/zephyr/os.c
@@ -28,18 +28,19 @@
 /* D(void *os_malloc(size_t size)) */
 void *os_calloc(size_t nelem, size_t size)
 {
-	/* Note that this doesn't check for overflow.  Assume the
-	 * calls only come from within the app. */
-	size_t total = nelem * size;
-	void *buf = k_malloc(total);
-	if (buf)
-		memset(buf, 0, total);
-	return buf;
+    /* Note that this doesn't check for overflow.  Assume the
+     * calls only come from within the app. */
+    size_t total = nelem * size;
+    void *buf = k_malloc(total);
+    if (buf) {
+        memset(buf, 0, total);
+    }
+    return buf;
 }
 
 void os_free(void *ptr)
 {
-	k_free(ptr);
+    k_free(ptr);
 }
 
 /*
@@ -47,5 +48,5 @@
  */
 void os_heap_init(void)
 {
-	mbedtls_platform_set_calloc_free(os_calloc, os_free);
+    mbedtls_platform_set_calloc_free(os_calloc, os_free);
 }