Skip to contentSkip to conversation

x86/mm/cpa-test: Correct length selection

PATCH In review Jason Andryuk 2 participants 3 messages Jan 25, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/mm/cpa-test: Correct length selection

The length of pages to modify corresponding to addr[i] is given in len[i]. Remove the hard coded 1.

---
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(-)
arch/x86/mm/pat/cpa-test.c +1 -1
index 3d2f7f0a6ed1..ad3c1feec990 100644
@@ -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:
Signature · 1 line
2.43.0
#1 lore raw
Quoted 6 lines · Jason Andryuk

The length of pages to modify corresponding to addr[i] is given in len[i]. Remove the hard coded 1.

---
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?

#2 lore raw
Quoted 5 lines · Dave Hansen
Quoted 3 lines · Jason Andryuk

The length of pages to modify corresponding to addr[i] is given in len[i]. Remove the hard coded 1.

Quoted 7 lines
Quoted 3 lines

---
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