x86: cpa, clean up code flow

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

+9 -11
+9 -11
arch/x86/mm/pageattr.c
··· 423 424 static int __change_page_attr(unsigned long address, struct cpa_data *cpa) 425 { 426 struct page *kpte_page; 427 - int level, do_split; 428 pte_t *kpte; 429 430 repeat: ··· 476 * and just change the pte: 477 */ 478 do_split = try_preserve_large_page(kpte, address, cpa); 479 - if (do_split < 0) 480 - return do_split; 481 - 482 /* 483 * When the range fits into the existing large page, 484 * return. cp->numpages and cpa->tlbflush have been updated in 485 * try_large_page: 486 */ 487 - if (do_split == 0) 488 - return 0; 489 490 /* 491 * We have to split the large page: 492 */ 493 - do_split = split_large_page(kpte, address); 494 - if (do_split) 495 - return do_split; 496 - cpa->flushtlb = 1; 497 498 - goto repeat; 499 } 500 501 /**
··· 423 424 static int __change_page_attr(unsigned long address, struct cpa_data *cpa) 425 { 426 + int level, do_split, err; 427 struct page *kpte_page; 428 pte_t *kpte; 429 430 repeat: ··· 476 * and just change the pte: 477 */ 478 do_split = try_preserve_large_page(kpte, address, cpa); 479 /* 480 * When the range fits into the existing large page, 481 * return. cp->numpages and cpa->tlbflush have been updated in 482 * try_large_page: 483 */ 484 + if (do_split <= 0) 485 + return do_split; 486 487 /* 488 * We have to split the large page: 489 */ 490 + err = split_large_page(kpte, address); 491 + if (!err) { 492 + cpa->flushtlb = 1; 493 + goto repeat; 494 + } 495 496 + return err; 497 } 498 499 /**