linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: XU pengfei <xupengfei@nfschina.com>
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Kernel@nfschina.com, Xu Pengfei <xupengfei@nfschina.com>
Subject: [PATCH] mm: Optimize the statement to make it clearer
Date: Fri, 13 May 2022 10:57:54 +0800	[thread overview]
Message-ID: <20220513025754.9230-1-xupengfei@nfschina.com> (raw)

From: Xu Pengfei <xupengfei@nfschina.com>

Optimize the statement to make it clearer

Signed-off-by: Xu Pengfei <xupengfei@nfschina.com>
---
 mm/filemap.c | 4 ++--
 mm/mmap.c    | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/mm/filemap.c b/mm/filemap.c
index 9a1eef6c5d35..f6b2b915052a 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1374,9 +1374,9 @@ static inline int folio_wait_bit_common(struct folio *folio, int bit_nr,
 	 * waiter, but an exclusive one requires WQ_FLAG_DONE.
 	 */
 	if (behavior == EXCLUSIVE)
-		return wait->flags & WQ_FLAG_DONE ? 0 : -EINTR;
+		return (wait->flags & WQ_FLAG_DONE) ? 0 : -EINTR;
 
-	return wait->flags & WQ_FLAG_WOKEN ? 0 : -EINTR;
+	return (wait->flags & WQ_FLAG_WOKEN) ? 0 : -EINTR;
 }
 
 #ifdef CONFIG_MIGRATION
diff --git a/mm/mmap.c b/mm/mmap.c
index 3aa839f81e63..28196b93515a 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2975,9 +2975,9 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
 			goto out;
 	}
 
-	prot |= vma->vm_flags & VM_READ ? PROT_READ : 0;
-	prot |= vma->vm_flags & VM_WRITE ? PROT_WRITE : 0;
-	prot |= vma->vm_flags & VM_EXEC ? PROT_EXEC : 0;
+	prot |= (vma->vm_flags & VM_READ) ? PROT_READ : 0;
+	prot |= (vma->vm_flags & VM_WRITE) ? PROT_WRITE : 0;
+	prot |= (vma->vm_flags & VM_EXEC) ? PROT_EXEC : 0;
 
 	flags &= MAP_NONBLOCK;
 	flags |= MAP_SHARED | MAP_FIXED | MAP_POPULATE;
-- 
2.18.2



                 reply	other threads:[~2022-05-13  2:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220513025754.9230-1-xupengfei@nfschina.com \
    --to=xupengfei@nfschina.com \
    --cc=Kernel@nfschina.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox