target/image: Use proper data types

While at it, fix some coding style issues.

Change-Id: Id521394d89e0bf787a6f812701c2cc0fe7e4e63f
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: http://openocd.zylin.com/5919
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
Marc Schink
2020-11-03 16:11:48 +01:00
committed by Antonio Borneo
parent 6dbfdcd00f
commit 73746d78b7
10 changed files with 46 additions and 56 deletions

View File

@@ -702,7 +702,7 @@ int flash_write_unlock(struct target *target, struct image *image,
{
int retval = ERROR_OK;
int section;
unsigned int section;
uint32_t section_offset;
struct flash_bank *c;
int *padding;
@@ -727,8 +727,8 @@ int flash_write_unlock(struct target *target, struct image *image,
* whereas an image can have sections out of order. */
struct imagesection **sections = malloc(sizeof(struct imagesection *) *
image->num_sections);
int i;
for (i = 0; i < image->num_sections; i++)
for (unsigned int i = 0; i < image->num_sections; i++)
sections[i] = &image->sections[i];
qsort(sections, image->num_sections, sizeof(struct imagesection *),
@@ -738,7 +738,7 @@ int flash_write_unlock(struct target *target, struct image *image,
while (section < image->num_sections) {
uint32_t buffer_idx;
uint8_t *buffer;
int section_last;
unsigned int section_last;
target_addr_t run_address = sections[section]->base_address + section_offset;
uint32_t run_size = sections[section]->size - section_offset;
int pad_bytes = 0;