aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-01-30 07:34:07 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:34:07 -0500
commit4692a1450b4d1000a942022b088c8791749dd65e (patch)
treedc1195d1b927b6b9735f816ddce86b98e09ab65b /arch
parenta72a08a4b61cb8868606a69b744848552e92062b (diff)
x86: cpa: fix loop
Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/mm/pageattr.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index a2ee317548f2..5cfc0d4ade56 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -304,7 +304,7 @@ static int change_page_attr_addr(unsigned long address, pgprot_t prot)
304static int change_page_attr_set(unsigned long addr, int numpages, 304static int change_page_attr_set(unsigned long addr, int numpages,
305 pgprot_t prot) 305 pgprot_t prot)
306{ 306{
307 pgprot_t current_prot; 307 pgprot_t current_prot, new_prot;
308 int level; 308 int level;
309 pte_t *pte; 309 pte_t *pte;
310 int i, ret; 310 int i, ret;
@@ -317,9 +317,10 @@ static int change_page_attr_set(unsigned long addr, int numpages,
317 else 317 else
318 pgprot_val(current_prot) = 0; 318 pgprot_val(current_prot) = 0;
319 319
320 pgprot_val(prot) = pgprot_val(current_prot) | pgprot_val(prot); 320 pgprot_val(new_prot) =
321 pgprot_val(current_prot) | pgprot_val(prot);
321 322
322 ret = change_page_attr_addr(addr, prot); 323 ret = change_page_attr_addr(addr, new_prot);
323 if (ret) 324 if (ret)
324 return ret; 325 return ret;
325 addr += PAGE_SIZE; 326 addr += PAGE_SIZE;
@@ -349,7 +350,7 @@ static int change_page_attr_set(unsigned long addr, int numpages,
349static int change_page_attr_clear(unsigned long addr, int numpages, 350static int change_page_attr_clear(unsigned long addr, int numpages,
350 pgprot_t prot) 351 pgprot_t prot)
351{ 352{
352 pgprot_t current_prot; 353 pgprot_t current_prot, new_prot;
353 int level; 354 int level;
354 pte_t *pte; 355 pte_t *pte;
355 int i, ret; 356 int i, ret;
@@ -361,10 +362,10 @@ static int change_page_attr_clear(unsigned long addr, int numpages,
361 else 362 else
362 pgprot_val(current_prot) = 0; 363 pgprot_val(current_prot) = 0;
363 364
364 pgprot_val(prot) = 365 pgprot_val(new_prot) =
365 pgprot_val(current_prot) & ~pgprot_val(prot); 366 pgprot_val(current_prot) & ~pgprot_val(prot);
366 367
367 ret = change_page_attr_addr(addr, prot); 368 ret = change_page_attr_addr(addr, new_prot);
368 if (ret) 369 if (ret)
369 return ret; 370 return ret;
370 addr += PAGE_SIZE; 371 addr += PAGE_SIZE;