aboutsummaryrefslogtreecommitdiff
path: root/lib/utils
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-09-27 16:19:12 +0200
committerAnup Patel <anup@brainfault.org>2023-10-06 17:06:13 +0530
commit9da30f6105565c920d1e27c08cb67284619d6984 (patch)
tree06b2d5343849ec8cc9089738a800aec8fbceac24 /lib/utils
parent8197c2f1ec5bcdd3aa7477efef59e9ebd57ee331 (diff)
downloadopensbi-9da30f6105565c920d1e27c08cb67284619d6984.zip
opensbi-9da30f6105565c920d1e27c08cb67284619d6984.tar.gz
opensbi-9da30f6105565c920d1e27c08cb67284619d6984.tar.bz2
lib: utils/fdt: simplify dt_parse_isa_extensions
hart_exts == NULL can only occur if offset and node address lead to an overflow resulting in exactly NULL. As we don't catch other values of overflow it does not make sense to treat this one as special. Addresses-Coverity-ID: 1568355 Logically dead code Addresses-Coverity-ID: 1568358 Logically dead code Fixes: 6259b2ec2d09 ("lib: utils/fdt: Fix fdt_parse_isa_extensions() implementation") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Xiang W <wxjstz@126.com> Reviewed-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'lib/utils')
-rw-r--r--lib/utils/fdt/fdt_helper.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/lib/utils/fdt/fdt_helper.c b/lib/utils/fdt/fdt_helper.c
index c97f09d..13e79b9 100644
--- a/lib/utils/fdt/fdt_helper.c
+++ b/lib/utils/fdt/fdt_helper.c
@@ -417,8 +417,6 @@ static int fdt_parse_isa_all_harts(void *fdt)
hart_exts = sbi_scratch_offset_ptr(scratch,
fdt_isa_bitmap_offset);
- if (!hart_exts)
- return SBI_ENOENT;
err = fdt_parse_isa_one_hart((const char *)val, hart_exts);
if (err)
@@ -452,8 +450,6 @@ int fdt_parse_isa_extensions(void *fdt, unsigned int hartid,
return SBI_ENOENT;
hart_exts = sbi_scratch_offset_ptr(scratch, fdt_isa_bitmap_offset);
- if (!hart_exts)
- return SBI_ENOENT;
for (i = 0; i < BITS_TO_LONGS(SBI_HART_EXT_MAX); i++)
extensions[i] |= hart_exts[i];