From: Miaohe Lin Date: Sat, 16 Jul 2022 08:18:16 +0000 (+0800) Subject: mm: remove unneeded PageAnon check in restore_exclusive_pte() X-Git-Tag: howlett/maple/20220722_2~10 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=598a6bbb7031a53c62d6a7c9f5f2eb3d0252c5a6;p=users%2Fjedix%2Flinux-maple.git mm: remove unneeded PageAnon check in restore_exclusive_pte() When code reaches here, the page must be !PageAnon. There's no need to check PageAnon again. Remove it. Link: https://lkml.kernel.org/r/20220716081816.10752-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Signed-off-by: Andrew Morton --- diff --git a/mm/memory.c b/mm/memory.c index 051f081539654..fcbe7143fdc21 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -753,7 +753,7 @@ static void restore_exclusive_pte(struct vm_area_struct *vma, * Currently device exclusive access only supports anonymous * memory so the entry shouldn't point to a filebacked page. */ - WARN_ON_ONCE(!PageAnon(page)); + WARN_ON_ONCE(1); set_pte_at(vma->vm_mm, address, ptep, pte);