[PATCH 2/4] arm64: mm: fix the count comments in compute_indices

Mark Rutland mark.rutland at arm.com
Tue May 18 05:35:11 PDT 2021


On Tue, May 18, 2021 at 06:14:03PM +0800, Dong Aisheng wrote:
> 'count - 1' is confusing and not comply with the real code running.
> 'count' actually represents the extra entries required, no need minus 1.
> 
> Signed-off-by: Dong Aisheng <aisheng.dong at nxp.com>

This looks right to me, but I'm not all that familiar with this code.

Steve, does this make sense to you?

Mark.

> ---
>  arch/arm64/kernel/head.S | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S
> index 96873dfa67fd..b70db34458ec 100644
> --- a/arch/arm64/kernel/head.S
> +++ b/arch/arm64/kernel/head.S
> @@ -195,7 +195,7 @@ SYM_CODE_END(preserve_boot_args)
>  	and	\iend, \iend, \istart	// iend = (vend >> shift) & (ptrs - 1)
>  	mov	\istart, \ptrs
>  	mul	\istart, \istart, \count
> -	add	\iend, \iend, \istart	// iend += (count - 1) * ptrs
> +	add	\iend, \iend, \istart	// iend += count * ptrs
>  					// our entries span multiple tables
>  
>  	lsr	\istart, \vstart, \shift
> -- 
> 2.25.1
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel



More information about the linux-arm-kernel mailing list