Skip to content

Commit 669afa4

Browse files
btw616richardweinberger
authored andcommitted
um: Remove the redundant newpage check in update_pte_range
The two checks have been identical since commit ef714f1 ("um: remove force_flush_all from fork_handler"). And the inner one isn't necessary anymore. Signed-off-by: Tiwei Bie <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
1 parent 2fcd16f commit 669afa4

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

arch/um/kernel/tlb.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,12 @@ static inline int update_pte_range(pmd_t *pmd, unsigned long addr,
8282
(x ? UM_PROT_EXEC : 0));
8383
if (pte_newpage(*pte)) {
8484
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);
90-
91-
ret = ops->mmap(ops->mm_idp, addr,
92-
PAGE_SIZE, prot, fd,
93-
offset);
94-
}
85+
__u64 offset;
86+
unsigned long phys = pte_val(*pte) & PAGE_MASK;
87+
int fd = phys_mapping(phys, &offset);
88+
89+
ret = ops->mmap(ops->mm_idp, addr, PAGE_SIZE,
90+
prot, fd, offset);
9591
} else
9692
ret = ops->unmap(ops->mm_idp, addr, PAGE_SIZE);
9793
} else if (pte_newprot(*pte))

0 commit comments

Comments
 (0)