linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: Dong Aisheng <aisheng.dong@nxp.com>,
	Steve Capper <steve.capper@arm.com>,
	linux-arm-kernel@lists.infradead.org, dongas86@gmail.com,
	Will Deacon <will@kernel.org>
Subject: Re: [PATCH 2/4] arm64: mm: fix the count comments in compute_indices
Date: Tue, 15 Jun 2021 14:29:54 +0100	[thread overview]
Message-ID: <20210615132953.GE26027@arm.com> (raw)
In-Reply-To: <20210518123511.GI82842@C02TD0UTHF1T.local>

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@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@arm.com>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-06-15 14:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18 10:14 [PATCH 0/4] arm64: mm: a few small cleanups Dong Aisheng
2021-05-18 10:14 ` [PATCH 1/4] arm64: mm: remove unneeded SWAPPER_INIT_MAP_SIZE Dong Aisheng
2021-05-18 12:13   ` Mark Rutland
2021-06-15 13:31   ` Catalin Marinas
2021-05-18 10:14 ` [PATCH 2/4] arm64: mm: fix the count comments in compute_indices Dong Aisheng
2021-05-18 12:35   ` Mark Rutland
2021-06-15 13:29     ` Catalin Marinas [this message]
2021-05-18 10:14 ` [PATCH 3/4] arm64: mm: drop unused __pa(__idmap_text_start) Dong Aisheng
2021-05-18 12:19   ` Mark Rutland
2021-06-15 13:32   ` Catalin Marinas
2021-05-18 10:14 ` [PATCH 4/4] arm64: head: fix code comments in set_cpu_boot_mode_flag Dong Aisheng
2021-05-18 12:13   ` Mark Rutland
2021-06-15 13:31   ` Catalin Marinas
2021-06-15 19:18 ` [PATCH 0/4] arm64: mm: a few small cleanups Will Deacon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210615132953.GE26027@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=aisheng.dong@nxp.com \
    --cc=dongas86@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=steve.capper@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).