From: Xu Pengfei <xupengfei@xxxxxxxxxxxx> Optimize the statement to make it clearer Signed-off-by: Xu Pengfei <xupengfei@xxxxxxxxxxxx> --- 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