lists.openwall.net   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  linux-cve-announce  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]
Message-Id: <20181104124456.3424-1-tiny.windzz@gmail.com>
Date:   Sun,  4 Nov 2018 07:44:56 -0500
From:   Yangtao Li <tiny.windzz@...il.com>
To:     akpm@...ux-foundation.org, mhocko@...e.com,
        kirill.shutemov@...ux.intel.com, vbabka@...e.cz,
        yang.shi@...ux.alibaba.com, rientjes@...gle.com,
        linux@...inikbrodowski.net
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Yangtao Li <tiny.windzz@...il.com>
Subject: [PATCH] mm: mmap: remove unnecessary unlikely()

WARN_ON() already contains an unlikely(), so it's not necessary to use
unlikely.

Signed-off-by: Yangtao Li <tiny.windzz@...il.com>
---
 mm/mmap.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/mm/mmap.c b/mm/mmap.c
index 6c04292e16a7..2077008ade0c 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2965,10 +2965,8 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
 static inline void verify_mm_writelocked(struct mm_struct *mm)
 {
 #ifdef CONFIG_DEBUG_VM
-	if (unlikely(down_read_trylock(&mm->mmap_sem))) {
-		WARN_ON(1);
+	if (WARN_ON(down_read_trylock(&mm->mmap_sem)))
 		up_read(&mm->mmap_sem);
-	}
 #endif
 }
 
-- 
2.17.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ