From f26d8f44b0af156ee03c72e57bd4d89e21d79b80 Mon Sep 17 00:00:00 2001 From: Samuel MARTIN Date: Fri, 12 Jan 2024 14:27:30 +0100 Subject: [PATCH] direct-xip : Do not compile boot_version_cmp when MCUBOOT_DIRECT_XIP_DOWNGRADE_ALLOWED is set Avoid compilation warning about unused function. Signed-off-by: Samuel MARTIN --- boot/bootutil/src/loader.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boot/bootutil/src/loader.c b/boot/bootutil/src/loader.c index d1043f7ef5..65e3974c1f 100644 --- a/boot/bootutil/src/loader.c +++ b/boot/bootutil/src/loader.c @@ -613,6 +613,7 @@ boot_check_header_erased(struct boot_loader_state *state, int slot) return 0; } +#if !defined(MCUBOOT_DIRECT_XIP_DOWNGRADE_ALLOWED) #if (BOOT_IMAGE_NUMBER > 1) || \ defined(MCUBOOT_DIRECT_XIP) || \ defined(MCUBOOT_RAM_LOAD) || \ @@ -656,6 +657,7 @@ boot_version_cmp(const struct image_version *ver1, return 0; } #endif +#endif #if defined(MCUBOOT_DIRECT_XIP) /**