All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yangtao Li <tiny.windzz@gmail.com>
To: akpm@linux-foundation.org, mhocko@suse.com,
	kirill.shutemov@linux.intel.com, vbabka@suse.cz,
	yang.shi@linux.alibaba.com, rientjes@google.com,
	linux@dominikbrodowski.net
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Yangtao Li <tiny.windzz@gmail.com>
Subject: [PATCH] mm: mmap: remove unnecessary unlikely()
Date: Sun,  4 Nov 2018 07:44:56 -0500	[thread overview]
Message-ID: <20181104124456.3424-1-tiny.windzz@gmail.com> (raw)

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

Signed-off-by: Yangtao Li <tiny.windzz@gmail.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

             reply	other threads:[~2018-11-04 12:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-04 12:44 Yangtao Li [this message]
2018-11-05  6:51 ` [PATCH] mm: mmap: remove unnecessary unlikely() Michal Hocko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181104124456.3424-1-tiny.windzz@gmail.com \
    --to=tiny.windzz@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@dominikbrodowski.net \
    --cc=mhocko@suse.com \
    --cc=rientjes@google.com \
    --cc=vbabka@suse.cz \
    --cc=yang.shi@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.