mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-24 23:41:23 +01:00
lib: utils: Simplify SET_ISA_EXT_MAP()
The define is hard to read. The continue statement does not do what was
intended.
* Remove do {} while (false);
* Change the name to set_multi_letter_ext
- Other local macros are lower case too.
- Refer to the fact that this is only used for multi-letter extensions.
Addresses-Coverity-ID: 1568359 Unexpected control flow
Fixes: d72f5f1747
("lib: utils: Add detection of Smepmp from ISA string in FDT")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Xiang W <wxjstz@126.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:

committed by
Anup Patel

parent
9da30f6105
commit
942aca232e
@@ -369,16 +369,14 @@ static int fdt_parse_isa_one_hart(const char *isa, unsigned long *extensions)
|
|||||||
if (!j)
|
if (!j)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
#define SET_ISA_EXT_MAP(name, bit) \
|
#define set_multi_letter_ext(name, bit) \
|
||||||
do { \
|
|
||||||
if (!strcmp(mstr, name)) { \
|
if (!strcmp(mstr, name)) { \
|
||||||
__set_bit(bit, extensions); \
|
__set_bit(bit, extensions); \
|
||||||
continue; \
|
continue; \
|
||||||
} \
|
}
|
||||||
} while (false) \
|
|
||||||
|
|
||||||
SET_ISA_EXT_MAP("smepmp", SBI_HART_EXT_SMEPMP);
|
set_multi_letter_ext("smepmp", SBI_HART_EXT_SMEPMP);
|
||||||
#undef SET_ISA_EXT_MAP
|
#undef set_multi_letter_ext
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user