linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: Optimize the statement to make it clearer
@ 2022-05-13  2:57 XU pengfei
  0 siblings, 0 replies; only message in thread
From: XU pengfei @ 2022-05-13  2:57 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, Kernel, Xu Pengfei

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



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-13  2:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-13  2:57 [PATCH] mm: Optimize the statement to make it clearer XU pengfei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox