Skip to content

Commit 55fdfa7

Browse files
GoldenBugfacebook-github-bot
authored andcommitted
Fixed printf Formatting and Removed Non-Functional Check.
Summary: There were several printf format warnings that needed to be fixed. There was also a check that did not do anything because it always equated to false. Reviewed By: garnermic Differential Revision: D37330344 fbshipit-source-id: 73f0832b0831943ac4a03b439547cbcbc5c17ff1
1 parent df90a79 commit 55fdfa7

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

‎common/lib/util_spi.c‎

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,19 @@ static int do_erase_write_verify(const struct device *flash_device, uint32_t op_
2525

2626
ret = flash_erase(flash_device, op_addr, erase_sz);
2727
if (ret != 0) {
28-
printf("[%s][%d] erase failed at %d.\n", __func__, __LINE__, op_addr);
28+
printf("[%s][%d] erase failed at %u.\n", __func__, __LINE__, op_addr);
2929
goto end;
3030
}
3131

3232
ret = flash_write(flash_device, op_addr, write_buf, erase_sz);
3333
if (ret != 0) {
34-
printf("[%s][%d] write failed at %d.\n", __func__, __LINE__, op_addr);
34+
printf("[%s][%d] write failed at %u.\n", __func__, __LINE__, op_addr);
3535
goto end;
3636
}
3737

3838
ret = flash_read(flash_device, op_addr, read_back_buf, erase_sz);
3939
if (ret != 0) {
40-
printf("[%s][%d] write failed at %d.\n", __func__, __LINE__, op_addr);
40+
printf("[%s][%d] write failed at %u.\n", __func__, __LINE__, op_addr);
4141
goto end;
4242
}
4343

@@ -76,22 +76,22 @@ static int do_update(const struct device *flash_device, off_t offset, uint8_t *b
7676
bool update_it = false;
7777

7878
if (flash_sz < flash_offset + len) {
79-
printf("ERROR: update boundary exceeds flash size. (%d, %d, %u)\n", flash_sz,
79+
printf("ERROR: update boundary exceeds flash size. (%u, %u, %lu)\n", flash_sz,
8080
flash_offset, len);
8181
ret = -EINVAL;
8282
goto end;
8383
}
8484

8585
op_buf = (uint8_t *)malloc(sector_sz);
8686
if (op_buf == NULL) {
87-
printf("heap full %d %d\n", __LINE__, sector_sz);
87+
printf("heap full %d %u\n", __LINE__, sector_sz);
8888
ret = -EINVAL;
8989
goto end;
9090
}
9191

9292
read_back_buf = (uint8_t *)malloc(sector_sz);
9393
if (read_back_buf == NULL) {
94-
printf("heap full %d %d\n", __LINE__, sector_sz);
94+
printf("heap full %d %u\n", __LINE__, sector_sz);
9595
ret = -EINVAL;
9696
goto end;
9797
}
@@ -171,10 +171,6 @@ uint8_t fw_update(uint32_t offset, uint16_t msg_len, uint8_t *msg_buf, bool sect
171171
const struct device *flash_dev;
172172

173173
if (!is_init) {
174-
if ((offset & 0x0000) != 0) {
175-
return FWUPDATE_ERROR_OFFSET;
176-
}
177-
178174
SAFE_FREE(txbuf);
179175
txbuf = (uint8_t *)malloc(SECTOR_SZ_64K);
180176
if (txbuf == NULL) { // Retry alloc

0 commit comments

Comments
 (0)