diff options
author | Zijun Hu <quic_zijuhu@quicinc.com> | 2025-01-09 21:27:03 +0800 |
---|---|---|
committer | Rob Herring (Arm) <robh@kernel.org> | 2025-01-13 17:47:29 -0600 |
commit | ab7eeb7b43b0c3887c9811f34d157dec6343c8e4 (patch) | |
tree | b101944562f88daed1663736ec182e8e8574c58c | |
parent | 29091a52562bca4d6e678dd8f0085dac119d6a21 (diff) |
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 <quic_zijuhu@quicinc.com>
Link: https://lore.kernel.org/r/20250109-of_core_fix-v4-12-db8a72415b8c@quicinc.com
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
-rw-r--r-- | drivers/of/of_reserved_mem.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index 03a8f03ed1da..17c57118c496 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) { |