[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220513025754.9230-1-xupengfei@nfschina.com>
Date: Fri, 13 May 2022 10:57:54 +0800
From: XU pengfei <xupengfei@...china.com>
To: akpm@...ux-foundation.org
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Kernel@...china.com, Xu Pengfei <xupengfei@...china.com>
Subject: [PATCH] mm: Optimize the statement to make it clearer
From: Xu Pengfei <xupengfei@...china.com>
Optimize the statement to make it clearer
Signed-off-by: Xu Pengfei <xupengfei@...china.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
Powered by blists - more mailing lists