dfu: Cast offset to u32_t before calling LOG

Cast offset to u32_t before printing in hexadecimal form.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
This commit is contained in:
Jan Van Winkel 2019-01-02 23:47:53 +01:00 committed by Anas Nashif
commit 8fb4384927

View file

@ -35,14 +35,14 @@ static bool flash_verify(struct device *dev, off_t offset,
rc = flash_read(dev, offset, &temp, size); rc = flash_read(dev, offset, &temp, size);
if (rc) { if (rc) {
LOG_ERR("flash_read error %d offset=0x%08"PRIx32, LOG_ERR("flash_read error %d offset=0x%08"PRIx32,
rc, offset); rc, (u32_t)offset);
break; break;
} }
if (memcmp(data, &temp, size)) { if (memcmp(data, &temp, size)) {
LOG_ERR("offset=0x%08"PRIx32" VERIFY FAIL. " LOG_ERR("offset=0x%08"PRIx32" VERIFY FAIL. "
"expected: 0x%08x, actual: 0x%08x", "expected: 0x%08x, actual: 0x%08x",
offset, temp, *(__packed u32_t*)data); (u32_t)offset, temp, *(__packed u32_t*)data);
break; break;
} }
len -= size; len -= size;
@ -71,7 +71,7 @@ static int flash_block_write(struct flash_img_context *ctx, off_t offset,
flash_write_protection_set(ctx->dev, true); flash_write_protection_set(ctx->dev, true);
if (rc) { if (rc) {
LOG_ERR("flash_write error %d offset=0x%08"PRIx32, LOG_ERR("flash_write error %d offset=0x%08"PRIx32,
rc, offset + ctx->bytes_written); rc, (u32_t)(offset + ctx->bytes_written));
return rc; return rc;
} }
@ -103,7 +103,7 @@ static int flash_block_write(struct flash_img_context *ctx, off_t offset,
flash_write_protection_set(ctx->dev, true); flash_write_protection_set(ctx->dev, true);
if (rc) { if (rc) {
LOG_ERR("flash_write error %d offset=0x%08"PRIx32, LOG_ERR("flash_write error %d offset=0x%08"PRIx32,
rc, offset + ctx->bytes_written); rc, (u32_t)(offset + ctx->bytes_written));
return rc; return rc;
} }