Skip to content

Commit f31245d

Browse files
ccollins476adAnas Nashif
authored andcommitted
subsys: dfu: boot: Remove unused ver query code.
Duplicate code to query was mistakenly added in commit 2ad7ccd. This code is redundant; the existing `boot_read_bank_header()` function can read the version from both image banks. Signed-off-by: Christopher Collins <[email protected]>
1 parent d9bd690 commit f31245d

File tree

2 files changed

+0
-23
lines changed

2 files changed

+0
-23
lines changed

include/dfu/mcuboot.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@
3030

3131
#define BOOT_IMG_VER_STRLEN_MAX 25 /* 255.255.65535.4294967295\0 */
3232

33-
struct image_version {
34-
u8_t iv_major;
35-
u8_t iv_minor;
36-
u16_t iv_revision;
37-
u32_t iv_build_num;
38-
};
39-
4033
/**
4134
* @brief MCUboot image header representation for image version
4235
*
@@ -146,8 +139,6 @@ bool boot_is_img_confirmed(void);
146139
*/
147140
int boot_write_img_confirmed(void);
148141

149-
int boot_current_image_version(struct image_version *out_ver);
150-
151142
/**
152143
* @brief Determines the action, if any, that mcuboot will take on the next
153144
* reboot.

subsys/dfu/boot/mcuboot.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ struct mcuboot_v1_raw_header {
7676
#define FLASH_STATE_OFFSET (FLASH_AREA_IMAGE_SCRATCH_OFFSET +\
7777
FLASH_AREA_IMAGE_SCRATCH_SIZE)
7878

79-
#define VERSION_OFFSET(bank_offs) (bank_offs + 20)
8079
#define COPY_DONE_OFFS(bank_offs) (bank_offs + FLASH_BANK_SIZE -\
8180
BOOT_MAGIC_SZ - BOOT_MAX_ALIGN * 2)
8281

@@ -253,14 +252,6 @@ static int boot_copy_done_read(u32_t bank_offs)
253252
return boot_flag_read(BOOT_FLAG_COPY_DONE, bank_offs);
254253
}
255254

256-
static int boot_version_read(u32_t bank_offs, struct image_version *out_ver)
257-
{
258-
u32_t offs;
259-
260-
offs = VERSION_OFFSET(bank_offs);
261-
return flash_read(flash_dev, offs, out_ver, sizeof(*out_ver));
262-
}
263-
264255
static int boot_magic_write(u32_t bank_offs)
265256
{
266257
u32_t offs;
@@ -412,11 +403,6 @@ static int boot_read_swap_state(u32_t bank_offs, struct boot_swap_state *state)
412403
return 0;
413404
}
414405

415-
int boot_current_image_version(struct image_version *out_ver)
416-
{
417-
return boot_version_read(FLASH_BANK0_OFFSET, out_ver);
418-
}
419-
420406
int boot_swap_type(void)
421407
{
422408
const struct boot_swap_table *table;

0 commit comments

Comments
 (0)