Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

um: Remove the redundant newpage check in update_pte_range

The two checks have been identical since commit ef714f15027c ("um:
remove force_flush_all from fork_handler"). And the inner one isn't
necessary anymore.

Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com>
Signed-off-by: Richard Weinberger <richard@nod.at>

authored by

Tiwei Bie and committed by
Richard Weinberger
669afa4e 2fcd16fb

+5 -9
+5 -9
arch/um/kernel/tlb.c
··· 82 82 (x ? UM_PROT_EXEC : 0)); 83 83 if (pte_newpage(*pte)) { 84 84 if (pte_present(*pte)) { 85 - if (pte_newpage(*pte)) { 86 - __u64 offset; 87 - unsigned long phys = 88 - pte_val(*pte) & PAGE_MASK; 89 - int fd = phys_mapping(phys, &offset); 85 + __u64 offset; 86 + unsigned long phys = pte_val(*pte) & PAGE_MASK; 87 + int fd = phys_mapping(phys, &offset); 90 88 91 - ret = ops->mmap(ops->mm_idp, addr, 92 - PAGE_SIZE, prot, fd, 93 - offset); 94 - } 89 + ret = ops->mmap(ops->mm_idp, addr, PAGE_SIZE, 90 + prot, fd, offset); 95 91 } else 96 92 ret = ops->unmap(ops->mm_idp, addr, PAGE_SIZE); 97 93 } else if (pte_newprot(*pte))