]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
arm64: mm: Remove bogus stop condition from map_mem() loop
authorArd Biesheuvel <ardb@kernel.org>
Fri, 29 May 2026 15:01:52 +0000 (17:01 +0200)
committerWill Deacon <will@kernel.org>
Tue, 2 Jun 2026 15:29:15 +0000 (16:29 +0100)
The memblock API guarantees that start is not greater than or equal to
end, so there is no need to test it. And if it were, it is doubtful that
breaking out of the loop would be a reasonable course of action here
(rather than attempting to map the remaining regions)

So let's drop this check.

Reviewed-by: Ryan Roberts <ryan.roberts@arm.com>
Reviewed-by: Kevin Brodsky <kevin.brodsky@arm.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/mm/mmu.c

index 4c8959153ac47d0a35ac55c99701c4e5734a5d04..96ab9e822bb18a056006f900217aae7099ee71d1 100644 (file)
@@ -1173,8 +1173,6 @@ static void __init map_mem(pgd_t *pgdp)
 
        /* map all the memory banks */
        for_each_mem_range(i, &start, &end) {
-               if (start >= end)
-                       break;
                /*
                 * The linear map must allow allocation tags reading/writing
                 * if MTE is present. Otherwise, it has the same attributes as