From 75a3d74c230c29fc17a3d5ccd910e805b6aa0251 Mon Sep 17 00:00:00 2001 From: Sylvio Alves Date: Mon, 1 Jul 2024 13:12:27 -0300 Subject: [PATCH] boot: main: avoid unused build warning In case ESP32 SoC is used, *start will get build warning as it is not used. Signed-off-by: Sylvio Alves --- boot/zephyr/main.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/boot/zephyr/main.c b/boot/zephyr/main.c index 74299698d..c89f3551d 100644 --- a/boot/zephyr/main.c +++ b/boot/zephyr/main.c @@ -277,23 +277,23 @@ static void copy_img_to_SRAM(int slot, unsigned int hdr_offset) */ static void do_boot(struct boot_rsp *rsp) { - void *start; - BOOT_LOG_INF("br_image_off = 0x%x\n", rsp->br_image_off); BOOT_LOG_INF("ih_hdr_size = 0x%x\n", rsp->br_hdr->ih_hdr_size); -#ifdef CONFIG_SOC_FAMILY_ESPRESSIF_ESP32 - int slot = (rsp->br_image_off == IMAGE0_PRIMARY_START_ADDRESS) ? - PRIMARY_SLOT : SECONDARY_SLOT; - /* Load memory segments and start from entry point */ - start_cpu0_image(IMAGE_INDEX_0, slot, rsp->br_hdr->ih_hdr_size); -#else +#ifndef CONFIG_SOC_FAMILY_ESPRESSIF_ESP32 + void *start; + /* Copy from the flash to HP SRAM */ copy_img_to_SRAM(0, rsp->br_hdr->ih_hdr_size); /* Jump to entry point */ start = (void *)(SRAM_BASE_ADDRESS + rsp->br_hdr->ih_hdr_size); ((void (*)(void))start)(); +#else + int slot = (rsp->br_image_off == IMAGE0_PRIMARY_START_ADDRESS) ? + PRIMARY_SLOT : SECONDARY_SLOT; + /* Load memory segments and start from entry point */ + start_cpu0_image(IMAGE_INDEX_0, slot, rsp->br_hdr->ih_hdr_size); #endif /* CONFIG_SOC_FAMILY_ESPRESSIF_ESP32 */ }