Skip to content

Commit 41f86c3

Browse files
aurel32carlescufi
authored andcommitted
nvs: fix warnings in logger
When compiling NVS with NEWLIB_LIBC=y, GCC outputs the following warning: In file included from $ZEPHYR/include/logging/log.h:11:0, from $ZEPHYR/subsys/fs/nvs/nvs.c:17: $ZEPHYR/subsys/fs/nvs/nvs.c: In function 'nvs_init': $ZEPHYR/subsys/fs/nvs/nvs.c:748:10: warning: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'u32_t {aka unsigned int}' [-Wformat=] LOG_INF("alloc wra: %d, %" PRIx32 "", ^ fs->ate_wra and fs->data_wra are both defined as u32_t, so they need to be printed with '%d'. Signed-off-by: Aurelien Jarno <[email protected]>
1 parent 3110937 commit 41f86c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subsys/fs/nvs/nvs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,10 +745,10 @@ int nvs_init(struct nvs_fs *fs, const char *dev_name)
745745
}
746746

747747
LOG_INF("%d Sectors of %d bytes", fs->sector_count, fs->sector_size);
748-
LOG_INF("alloc wra: %d, %" PRIx32 "",
748+
LOG_INF("alloc wra: %d, %d",
749749
(fs->ate_wra >> ADDR_SECT_SHIFT),
750750
(fs->ate_wra & ADDR_OFFS_MASK));
751-
LOG_INF("data wra: %d, %" PRIx32 "",
751+
LOG_INF("data wra: %d, %d",
752752
(fs->data_wra >> ADDR_SECT_SHIFT),
753753
(fs->data_wra & ADDR_OFFS_MASK));
754754
LOG_INF("Free space: %d", fs->free_space);

0 commit comments

Comments
 (0)