]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
um: Remove the redundant newpage check in update_pte_range
authorTiwei Bie <tiwei.btw@antgroup.com>
Mon, 26 Aug 2024 10:08:10 +0000 (18:08 +0800)
committerRichard Weinberger <richard@nod.at>
Thu, 12 Sep 2024 18:34:39 +0000 (20:34 +0200)
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>
arch/um/kernel/tlb.c

index 44c6fc697f3a8c431c3dd501784bddf37085c5b8..548af31d4111bb49d74c333eb060558929d83a05 100644 (file)
@@ -82,16 +82,12 @@ static inline int update_pte_range(pmd_t *pmd, unsigned long addr,
                        (x ? UM_PROT_EXEC : 0));
                if (pte_newpage(*pte)) {
                        if (pte_present(*pte)) {
-                               if (pte_newpage(*pte)) {
-                                       __u64 offset;
-                                       unsigned long phys =
-                                               pte_val(*pte) & PAGE_MASK;
-                                       int fd =  phys_mapping(phys, &offset);
-
-                                       ret = ops->mmap(ops->mm_idp, addr,
-                                                       PAGE_SIZE, prot, fd,
-                                                       offset);
-                               }
+                               __u64 offset;
+                               unsigned long phys = pte_val(*pte) & PAGE_MASK;
+                               int fd = phys_mapping(phys, &offset);
+
+                               ret = ops->mmap(ops->mm_idp, addr, PAGE_SIZE,
+                                               prot, fd, offset);
                        } else
                                ret = ops->unmap(ops->mm_idp, addr, PAGE_SIZE);
                } else if (pte_newprot(*pte))