[PATCH v4 05/15] arm64: mm: Remove bogus stop condition from map_mem() loop
Kevin Brodsky
kevin.brodsky at arm.com
Tue Apr 28 07:33:14 PDT 2026
On 27/04/2026 17:34, Ard Biesheuvel wrote:
> From: Ard Biesheuvel <ardb at kernel.org>
>
> 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 at arm.com>
> Signed-off-by: Ard Biesheuvel <ardb at kernel.org>
Reviewed-by: Kevin Brodsky <kevin.brodsky at arm.com>
> ---
> arch/arm64/mm/mmu.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
> index 005844e521bd..bfbf3fe0d1be 100644
> --- a/arch/arm64/mm/mmu.c
> +++ b/arch/arm64/mm/mmu.c
> @@ -1177,8 +1177,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
More information about the linux-arm-kernel
mailing list