]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
of: reserved-memory: Move an assignment to effective place in __reserved_mem_alloc_size()
authorZijun Hu <quic_zijuhu@quicinc.com>
Thu, 9 Jan 2025 13:27:03 +0000 (21:27 +0800)
committerRob Herring (Arm) <robh@kernel.org>
Mon, 13 Jan 2025 23:47:29 +0000 (17:47 -0600)
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>
drivers/of/of_reserved_mem.c

index 03a8f03ed1da165d6d7bf907d931857260888225..17c57118c4960d8ac502add1904f7f464258f5a1 100644 (file)
@@ -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) {