Skip to content

Commit 098fdb7

Browse files
author
Maxime Ripard
committed
of: reserved-memory: Move an assignment to effective place in __reserved_mem_alloc_size()
JIRA: https://issues.redhat.com/browse/RHEL-125402 commit ab7eeb7 Author: Zijun Hu <quic_zijuhu@quicinc.com> Date: 2025-01-09 21:27:03 +0800 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> Signed-off-by: Maxime Ripard <mripard@redhat.com>
1 parent 3dcaa6d commit 098fdb7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/of/of_reserved_mem.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,13 +436,12 @@ static int __init __reserved_mem_alloc_size(unsigned long node, const char *unam
436436
return -EINVAL;
437437
}
438438

439-
base = 0;
440-
441439
while (len > 0) {
442440
start = dt_mem_next_cell(dt_root_addr_cells, &prop);
443441
end = start + dt_mem_next_cell(dt_root_size_cells,
444442
&prop);
445443

444+
base = 0;
446445
ret = __reserved_mem_alloc_in_range(size, align,
447446
start, end, nomap, &base);
448447
if (ret == 0) {

0 commit comments

Comments
 (0)