[PATCH][libubootenv] uboot_env: Fix Wswitch compiler warnings

7 views
Skip to first unread message

Christian Storm

unread,
Jul 20, 2026, 9:58:29 AMJul 20
to swup...@googlegroups.com
FLAGS_NONE is not handled, add it behaving as NOP, i.e.,
the original flags value is used unmodified.

This doesn't change current behaviour but makes it
explicit (and fixes the compiler warning).

Signed-off-by: Christian Storm <christi...@siemens.com>
---
src/uboot_env.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/src/uboot_env.c b/src/uboot_env.c
index 96d23bf..ea58f6d 100644
--- a/src/uboot_env.c
+++ b/src/uboot_env.c
@@ -582,6 +582,8 @@ int libuboot_env_store(struct uboot_ctx *ctx)
case FLAGS_BOOLEAN:
flags = 1;
break;
+ case FLAGS_NONE:
+ break;
}
((struct uboot_env_redund *)image)->flags = flags;
}
@@ -674,6 +676,8 @@ static int libuboot_load(struct uboot_ctx *ctx)
else
ctx->current = 0;
switch (ctx->envdevs[0].flagstype) {
+ case FLAGS_NONE:
+ break;
case FLAGS_BOOLEAN:
if (ctx->envdevs[1].flags == 0xFF)
ctx->current = 1;
--
2.55.0

Stefano Babic

unread,
Jul 27, 2026, 11:52:33 AM (9 days ago) Jul 27
to Christian Storm, swup...@googlegroups.com
Applied to -master, thanks !

Best regards,
Stefano

--
_______________________________________________________________________
Nabla Software Engineering GmbH
Hirschstr. 111A | 86156 Augsburg | Tel: +49 821 45592596
Geschäftsführer : Stefano Babic | HRB 40522 Augsburg
E-Mail: sba...@nabladev.com

Reply all
Reply to author
Forward
0 new messages