From 7dfed1430418592ba6326cd0dd86f515de97d4dc Mon Sep 17 00:00:00 2001 From: _VIFEXTech Date: Tue, 2 Jan 2024 13:55:00 +0800 Subject: [PATCH] [fdb_kvdb]: fix shadow warning (#272) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ```bash FlashDB/src/fdb_kvdb.c: In function ‘read_sector_info’: FlashDB/src/fdb_kvdb.c:488:23: warning: declaration of ‘sector_cache’ shadows a previous local [-Wshadow] 488 | kv_sec_info_t sector_cache = get_sector_from_cache(db, sector->addr); | ^~~~~~~~~~~~ FlashDB/src/fdb_kvdb.c:421:19: note: shadowed declaration is here 421 | kv_sec_info_t sector_cache = get_sector_from_cache(db, addr); | ^~~~~~~~~~~~ ``` Signed-off-by: FASTSHIFT --- src/fdb_kvdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fdb_kvdb.c b/src/fdb_kvdb.c index 384d016..c668e44 100644 --- a/src/fdb_kvdb.c +++ b/src/fdb_kvdb.c @@ -485,8 +485,8 @@ static fdb_err_t read_sector_info(fdb_kvdb_t db, uint32_t addr, kv_sec_info_t se #ifdef FDB_KV_USING_CACHE update_sector_cache(db, sector); } else { - kv_sec_info_t sector_cache = get_sector_from_cache(db, sector->addr); - if (!sector_cache) { + kv_sec_info_t sec_cache = get_sector_from_cache(db, sector->addr); + if (!sec_cache) { sector->empty_kv = FAILED_ADDR; sector->remain = 0; update_sector_cache(db, sector);