Skip to content

Commit

Permalink
mm: remove redundant check non_swap_entry()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Reviewed-by: Jason Gunthorpe <[email protected]>
Acked-by: David Hildenbrand <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Ralph Campbell authored and torvalds committed Aug 7, 2020
1 parent a6f23d1 commit 463b7a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,7 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb,
}

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)) {
Expand Down

0 comments on commit 463b7a1

Please sign in to comment.