[PATCH v3 0/8] of/fdt: Some bug fixes and cleanups

From: Yuntao Wang

Date: Sat Nov 15 2025 - 08:48:47 EST


This patch series fixes several bugs related to dt_root_addr_cells and
dt_root_size_cells, and performs some cleanup.

Changelog:

v2 -> v3:
- Use of_flat_dt_ instead of of_fdt_ as the prefix for the newly added
helper functions

- Improve the internal logic of of_flat_dt_get_addr_size_prop() and
of_flat_dt_get_addr_size()

- Introduce the entry_index parameter for of_flat_dt_read_addr_size()

- Fix some warnings and coding-style issues

v1 -> v2:
- Consolidate duplicate code into helper functions

Links to previous patch series:

v2: https://lore.kernel.org/linux-devicetree/20251113155104.226617-1-yuntao.wang@xxxxxxxxx/
v1: https://lore.kernel.org/linux-devicetree/20251112143520.233870-1-yuntao.wang@xxxxxxxxx/

Yuntao Wang (8):
of/fdt: Consolidate duplicate code into helper functions
of/fdt: Fix the len check in early_init_dt_check_for_elfcorehdr()
of/fdt: Fix the len check in
early_init_dt_check_for_usable_mem_range()
of/fdt: Fix incorrect use of dt_root_addr_cells in
early_init_dt_check_kho()
of/fdt: Simplify the logic of early_init_dt_scan_memory()
of/reserved_mem: Simplify the logic of __reserved_mem_reserve_reg()
of/reserved_mem: Simplify the logic of
fdt_scan_reserved_mem_reg_nodes()
of/reserved_mem: Simplify the logic of __reserved_mem_alloc_size()

drivers/of/fdt.c | 101 ++++++++++++++++++++++-------------
drivers/of/of_reserved_mem.c | 69 ++++++++----------------
include/linux/of_fdt.h | 9 ++++
3 files changed, 97 insertions(+), 82 deletions(-)

--
2.51.0