diff mbox series

mm: remove unneeded PageAnon check in restore_exclusive_pte()

Message ID 20220716081816.10752-1-linmiaohe@huawei.com (mailing list archive)
State New
Headers show
Series mm: remove unneeded PageAnon check in restore_exclusive_pte() | expand

Commit Message

Miaohe Lin July 16, 2022, 8:18 a.m. UTC
When code reaches here, the page must be !PageAnon. There's no need to
check PageAnon again. Remove it.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 mm/memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Hildenbrand July 18, 2022, 1:03 p.m. UTC | #1
On 16.07.22 10:18, Miaohe Lin wrote:
> When code reaches here, the page must be !PageAnon. There's no need to
> check PageAnon again. Remove it.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
>  mm/memory.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/memory.c b/mm/memory.c
> index f671b2dce1fe..d98f89cee3e9 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);
>  

Reviewed-by: David Hildenbrand <david@redhat.com>
diff mbox series

Patch

diff --git a/mm/memory.c b/mm/memory.c
index f671b2dce1fe..d98f89cee3e9 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);