From: Zijun Hu Date: Thu, 9 Jan 2025 13:27:03 +0000 (+0800) Subject: of: reserved-memory: Move an assignment to effective place in __reserved_mem_alloc_size() X-Git-Tag: v6.14-rc1~100^2~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ab7eeb7b43b0c3887c9811f34d157dec6343c8e4;p=thirdparty%2Fkernel%2Flinux.git of: reserved-memory: Move an assignment to effective place in __reserved_mem_alloc_size() The assignment '@base = 0' in __reserved_mem_alloc_size() is meaningless since @base was already initialized to 0. Move the assignment to effective and proper place. Signed-off-by: Zijun Hu Link: https://lore.kernel.org/r/20250109-of_core_fix-v4-12-db8a72415b8c@quicinc.com Signed-off-by: Rob Herring (Arm) --- diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index 03a8f03ed1da1..17c57118c4960 100644 --- a/drivers/of/of_reserved_mem.c +++ b/drivers/of/of_reserved_mem.c @@ -436,13 +436,12 @@ static int __init __reserved_mem_alloc_size(unsigned long node, const char *unam return -EINVAL; } - base = 0; - while (len > 0) { start = dt_mem_next_cell(dt_root_addr_cells, &prop); end = start + dt_mem_next_cell(dt_root_size_cells, &prop); + base = 0; ret = __reserved_mem_alloc_in_range(size, align, start, end, nomap, &base); if (ret == 0) {