From: Ralph Campbell Date: Fri, 7 Aug 2020 06:22:21 +0000 (-0700) Subject: mm: remove redundant check non_swap_entry() X-Git-Tag: howlett/maple_spf/20210104~1298^2~69 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=463b7a173d52f0b15473171fe895ab3a3d852a5e;p=users%2Fjedix%2Flinux-maple.git mm: remove redundant check non_swap_entry() In zap_pte_range(), the check for non_swap_entry() and is_device_private_entry() is unnecessary since the latter is sufficient to determine if the page is a device private page. Remove the test for non_swap_entry() to simplify the code and for clarity. Signed-off-by: Ralph Campbell Signed-off-by: Andrew Morton Reviewed-by: Jason Gunthorpe Acked-by: David Hildenbrand Link: http://lkml.kernel.org/r/20200615175405.4613-1-rcampbell@nvidia.com Signed-off-by: Linus Torvalds --- diff --git a/mm/memory.c b/mm/memory.c index 0da48f6586f8..f4f27b9d48c5 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1098,7 +1098,7 @@ again: } entry = pte_to_swp_entry(ptent); - if (non_swap_entry(entry) && is_device_private_entry(entry)) { + if (is_device_private_entry(entry)) { struct page *page = device_private_entry_to_page(entry); if (unlikely(details && details->check_mapping)) {