Skip to content

Commit 10f8aa4

Browse files
committed
fix for -wunused-but-set-variable: guard inverse with DELTA_UPDATES
1 parent 4dd932e commit 10f8aa4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/update_flash.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,9 @@ static int RAMFUNCTION wolfBoot_update(int fallback_allowed)
671671
uint16_t update_type;
672672
uint32_t fw_size;
673673
uint32_t size;
674+
#if defined(DELTA_UPDATES)
674675
int inverse = 0;
676+
#endif
675677
int fallback_image = 0;
676678
#if defined(DISABLE_BACKUP) && defined(EXT_ENCRYPTED)
677679
uint8_t key[ENCRYPT_KEY_SIZE];
@@ -713,7 +715,7 @@ static int RAMFUNCTION wolfBoot_update(int fallback_allowed)
713715
wolfBoot_open_image(&boot, PART_BOOT);
714716
wolfBoot_open_image(&swap, PART_SWAP);
715717

716-
#ifdef EXT_ENCRYPTED
718+
#if defined(EXT_ENCRYPTED) && defined(DELTA_UPDATES)
717719
wolfBoot_printf("Update partition fallback image: %d\n", fallback_image);
718720
if (fallback_image)
719721
inverse = 1;
@@ -783,10 +785,11 @@ static int RAMFUNCTION wolfBoot_update(int fallback_allowed)
783785
}
784786
#endif
785787
}
788+
789+
#ifdef DELTA_UPDATES
786790
if (cur_ver > upd_ver)
787791
inverse = 1;
788792

789-
#ifdef DELTA_UPDATES
790793
if ((update_type & 0x00F0) == HDR_IMG_TYPE_DIFF) {
791794
/* if magic isn't set stateRet will be -1 but that means we're on a
792795
* fresh partition and aren't resuming */

0 commit comments

Comments
 (0)