Skip to content

Commit

Permalink
pkg: flashdb: patch to fix struct init
Browse files Browse the repository at this point in the history
Making the initialization of only one struct member explicit.
  • Loading branch information
OlegHahm committed Dec 6, 2023
1 parent de609f8 commit 1c5e481
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From fc0b3d177945f3b15b2cb0c6d07914d705bd6f4e Mon Sep 17 00:00:00 2001
From: Oleg Hahm <[email protected]>
Date: Wed, 6 Dec 2023 21:57:03 +0100
Subject: [PATCH 2/2] [kvdb] Initialize only status explicitly

---
src/fdb_kvdb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/fdb_kvdb.c b/src/fdb_kvdb.c
index a1118ce..505ba7b 100644
--- a/src/fdb_kvdb.c
+++ b/src/fdb_kvdb.c
@@ -937,7 +937,7 @@ static fdb_err_t del_kv(fdb_kvdb_t db, const char *key, fdb_kv_t old_kv, bool co
{
fdb_err_t result = FDB_NO_ERR;
uint32_t dirty_status_addr;
- struct fdb_kv kv = { FDB_KV_UNUSED };
+ struct fdb_kv kv = { .status = FDB_KV_UNUSED };

#if (KV_STATUS_TABLE_SIZE >= FDB_DIRTY_STATUS_TABLE_SIZE)
uint8_t status_table[KV_STATUS_TABLE_SIZE];
--
2.43.0

0 comments on commit 1c5e481

Please sign in to comment.