From 41f86c3db2509b617d155fbb1ce8dc573b70b790 Mon Sep 17 00:00:00 2001 From: Aurelien Jarno Date: Fri, 25 Jan 2019 21:26:46 +0100 Subject: [PATCH] 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 --- subsys/fs/nvs/nvs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subsys/fs/nvs/nvs.c b/subsys/fs/nvs/nvs.c index 19d813c8146..9b1cbdfb5f8 100644 --- a/subsys/fs/nvs/nvs.c +++ b/subsys/fs/nvs/nvs.c @@ -745,10 +745,10 @@ int nvs_init(struct nvs_fs *fs, const char *dev_name) } LOG_INF("%d Sectors of %d bytes", fs->sector_count, fs->sector_size); - LOG_INF("alloc wra: %d, %" PRIx32 "", + LOG_INF("alloc wra: %d, %d", (fs->ate_wra >> ADDR_SECT_SHIFT), (fs->ate_wra & ADDR_OFFS_MASK)); - LOG_INF("data wra: %d, %" PRIx32 "", + LOG_INF("data wra: %d, %d", (fs->data_wra >> ADDR_SECT_SHIFT), (fs->data_wra & ADDR_OFFS_MASK)); LOG_INF("Free space: %d", fs->free_space);