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

Catalin Marinas catalin.marinas at arm.com
Tue Jun 15 06:29:54 PDT 2021


On Tue, May 18, 2021 at 01:35:11PM +0100, Mark Rutland wrote:
> 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

The comment was updated to match the code. The code also looks ok to me:
iend is inclusive and count denotes the extra entries required rather
than the actual number of entries.

Also cc'ing Will, I think he missed this series.

Acked-by: Catalin Marinas <catalin.marinas at arm.com>



More information about the linux-arm-kernel mailing list