[PATCH] x86/mm/cpa-test: Correct length selection

Jason Andryuk posted 1 patch 1 year, 11 months ago
arch/x86/mm/pat/cpa-test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] x86/mm/cpa-test: Correct length selection
Posted by Jason Andryuk 1 year, 11 months ago
The length of pages to modify corresponding to addr[i] is given in
len[i].  Remove the hard coded 1.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
---
This is a typo, right?  The other cases use len[i].

 arch/x86/mm/pat/cpa-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/mm/pat/cpa-test.c b/arch/x86/mm/pat/cpa-test.c
index 3d2f7f0a6ed1..ad3c1feec990 100644
--- a/arch/x86/mm/pat/cpa-test.c
+++ b/arch/x86/mm/pat/cpa-test.c
@@ -183,7 +183,7 @@ static int pageattr_test(void)
 			break;
 
 		case 1:
-			err = change_page_attr_set(addrs, len[1], PAGE_CPA_TEST, 1);
+			err = change_page_attr_set(addrs, len[i], PAGE_CPA_TEST, 1);
 			break;
 
 		case 2:
-- 
2.43.0
Re: [PATCH] x86/mm/cpa-test: Correct length selection
Posted by Dave Hansen 1 year, 11 months ago
On 1/25/24 10:24, Jason Andryuk wrote:
> The length of pages to modify corresponding to addr[i] is given in
> len[i].  Remove the hard coded 1.
> 
> Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
> ---
> This is a typo, right?  The other cases use len[i].

Sure looks like it to me.

Any idea how this could have gone unnoticed for 5 years?
Re: [PATCH] x86/mm/cpa-test: Correct length selection
Posted by Jason Andryuk 1 year, 11 months ago
On Thu, Jan 25, 2024 at 1:30 PM Dave Hansen <dave.hansen@intel.com> wrote:
>
> On 1/25/24 10:24, Jason Andryuk wrote:
> > The length of pages to modify corresponding to addr[i] is given in
> > len[i].  Remove the hard coded 1.
> >
> > Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
> > ---
> > This is a typo, right?  The other cases use len[i].
>
> Sure looks like it to me.
>
> Any idea how this could have gone unnoticed for 5 years?

Not really, which is why I wondered if I was missing something.

Regards,
Jason