bootutil: consolidate helpers for old flash API
Move helpers which are needed for using flash_area_to_sectors() to the
end of file. This is just to keep things clean when we add support for
flash_area_get_sectors().
@@ -164,6 +164,20 @@ boot_img_num_sectors(struct boot_loader_state *state, size_t slot)
return state->imgs[slot].num_sectors;
}
+/*
+ * Offset of the slot from the beginning of the flash device.
+ */
+static inline uint32_t
+boot_img_slot_off(struct boot_loader_state *state, size_t slot)
+{
+ return state->imgs[slot].area->fa_off;
+}
+
+static inline size_t boot_scratch_area_size(struct boot_loader_state *state)
+{
+ return state->scratch_area->fa_size;
+}
+
static inline size_t
boot_img_sector_size(struct boot_loader_state *state,
size_t slot, size_t sector)
@@ -183,20 +197,6 @@ boot_img_sector_off(struct boot_loader_state *state, size_t slot,
state->imgs[slot].sectors[0].fa_off;
}
-/*
- * Offset of the slot from the beginning of the flash device.
- */
-static inline uint32_t
-boot_img_slot_off(struct boot_loader_state *state, size_t slot)
-{
- return state->imgs[slot].area->fa_off;
-}
-
-static inline size_t boot_scratch_area_size(struct boot_loader_state *state)
-{
- return state->scratch_area->fa_size;
-}
-
static inline int
boot_initialize_area(struct boot_loader_state *state, int flash_area)
{
