lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 12 Jun 2020 12:26:18 -0700
From:   Ralph Campbell <>
To:     <>, <>
CC:     Jerome Glisse <>,
        John Hubbard <>,
        Christoph Hellwig <>,
        Jason Gunthorpe <>,
        "Andrew Morton" <>,
        Ralph Campbell <>
Subject: [PATCH] mm/hmm: remove redundant check non_swap_entry()

In zap_pte_range(), the check for non_swap_entry() and
is_device_private_entry() is redundant since the latter is a subset of the
former. Remove the redundant check to simplify the code and for clarity.

Signed-off-by: Ralph Campbell <>

This is based on the current linux tree and is intended for Andrew's mm
tree. There is no rush so it could go into 5.9 but I think it is safe
enough to go into an rc after the patch is reviewed.

 mm/memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memory.c b/mm/memory.c
index dc7f3543b1fd..bdbb4f97e7d0 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -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)) {

Powered by blists - more mailing lists