[PATCH v3 1/7] lib utils/fdt: Drop fdt_parse_max_enabled_hart_id()
Samuel Holland
samuel.holland at sifive.com
Wed Oct 14 04:30:18 PDT 2026
This function is not used anywhere.
Reviewed-by: Anup Patel <anup at brainfault.org>
Signed-off-by: Samuel Holland <samuel.holland at sifive.com>
---
(no changes since v1)
include/sbi_utils/fdt/fdt_helper.h | 2 --
lib/utils/fdt/fdt_helper.c | 31 ------------------------------
2 files changed, 33 deletions(-)
diff --git a/include/sbi_utils/fdt/fdt_helper.h b/include/sbi_utils/fdt/fdt_helper.h
index 75a564d1..1246ab69 100644
--- a/include/sbi_utils/fdt/fdt_helper.h
+++ b/include/sbi_utils/fdt/fdt_helper.h
@@ -48,8 +48,6 @@ bool fdt_node_is_enabled(const void *fdt, int nodeoff);
int fdt_parse_hart_id(const void *fdt, int cpu_offset, u32 *hartid);
-int fdt_parse_max_enabled_hart_id(const void *fdt, u32 *max_hartid);
-
int fdt_parse_cbom_block_size(const void *fdt, int cpu_offset, unsigned long *cbom_block_size);
int fdt_parse_timebase_frequency(const void *fdt, unsigned long *freq);
diff --git a/lib/utils/fdt/fdt_helper.c b/lib/utils/fdt/fdt_helper.c
index 747ba028..f78ea39e 100644
--- a/lib/utils/fdt/fdt_helper.c
+++ b/lib/utils/fdt/fdt_helper.c
@@ -274,37 +274,6 @@ int fdt_parse_cbom_block_size(const void *fdt, int cpu_offset, unsigned long *cb
return 0;
}
-int fdt_parse_max_enabled_hart_id(const void *fdt, u32 *max_hartid)
-{
- u32 hartid;
- int err, cpu_offset, cpus_offset;
-
- if (!fdt)
- return SBI_EINVAL;
- if (!max_hartid)
- return 0;
-
- *max_hartid = 0;
-
- cpus_offset = fdt_path_offset(fdt, "/cpus");
- if (cpus_offset < 0)
- return cpus_offset;
-
- fdt_for_each_subnode(cpu_offset, fdt, cpus_offset) {
- err = fdt_parse_hart_id(fdt, cpu_offset, &hartid);
- if (err)
- continue;
-
- if (!fdt_node_is_enabled(fdt, cpu_offset))
- continue;
-
- if (hartid > *max_hartid)
- *max_hartid = hartid;
- }
-
- return 0;
-}
-
int fdt_parse_timebase_frequency(const void *fdt, unsigned long *freq)
{
const fdt32_t *val;
--
2.52.0
More information about the opensbi
mailing list