OpenSBI Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] lib: utils: Simplify SET_ISA_EXT_MAP()
@ 2023-09-27 14:21 Heinrich Schuchardt
  2023-09-27 15:23 ` Xiang W
  0 siblings, 1 reply; 4+ messages in thread
From: Heinrich Schuchardt @ 2023-09-27 14:21 UTC (permalink / raw)
  To: opensbi

The define is hard to read.

Addresses-Coverity-ID: 1568359 Unexpected control flow
Fixes: d72f5f17478d ("lib: utils: Add detection of Smepmp from ISA string in FDT")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
 lib/utils/fdt/fdt_helper.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/lib/utils/fdt/fdt_helper.c b/lib/utils/fdt/fdt_helper.c
index c97f09d..6f23f6f 100644
--- a/lib/utils/fdt/fdt_helper.c
+++ b/lib/utils/fdt/fdt_helper.c
@@ -370,12 +370,10 @@ static int fdt_parse_isa_one_hart(const char *isa, unsigned long *extensions)
 			continue;
 
 #define SET_ISA_EXT_MAP(name, bit)				\
-		do {						\
-			if (!strcmp(mstr, name)) {		\
+		{						\
+			if (!strcmp(mstr, name))		\
 				__set_bit(bit, extensions);	\
-				continue;			\
-			}					\
-		} while (false)					\
+		}						\
 
 		SET_ISA_EXT_MAP("smepmp", SBI_HART_EXT_SMEPMP);
 #undef SET_ISA_EXT_MAP
-- 
2.40.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-09-27 16:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-27 14:21 [PATCH 1/1] lib: utils: Simplify SET_ISA_EXT_MAP() Heinrich Schuchardt
2023-09-27 15:23 ` Xiang W
2023-09-27 15:38   ` Heinrich Schuchardt
2023-09-27 16:47     ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox