]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
mm: use false for bool variable
authorZou Wei <zou_wei@huawei.com>
Thu, 4 Jun 2020 23:49:46 +0000 (16:49 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 5 Jun 2020 02:06:24 +0000 (19:06 -0700)
Fixes coccicheck warnings:

  mm/zbud.c:246:1-20: WARNING: Assignment of 0/1 to bool variable
  mm/mremap.c:777:2-8: WARNING: Assignment of 0/1 to bool variable
  mm/huge_memory.c:525:9-10: WARNING: return of 0/1 in function 'is_transparent_hugepage' with return type bool

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zou Wei <zou_wei@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Link: http://lkml.kernel.org/r/1586835930-47076-1-git-send-email-zou_wei@huawei.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/huge_memory.c
mm/mremap.c
mm/zbud.c

index e8669885232fcdea675695eceb2a3246898885df..4368e964d2aa7e9df187a608d7aa074ab6ba0c72 100644 (file)
@@ -522,7 +522,7 @@ void prep_transhuge_page(struct page *page)
 bool is_transparent_hugepage(struct page *page)
 {
        if (!PageCompound(page))
-               return 0;
+               return false;
 
        page = compound_head(page);
        return is_huge_zero_page(page) ||
index 6aa6ea6050684ec5c6ee9fa58ffe2841e26efd84..dccb7a4471a08f5229a501e1a7801bc2e7288955 100644 (file)
@@ -785,7 +785,7 @@ SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len,
 out:
        if (offset_in_page(ret)) {
                vm_unacct_memory(charged);
-               locked = 0;
+               locked = false;
        }
        if (downgraded)
                up_read(&current->mm->mmap_sem);
index de5dd4ddaa828a029a8e47133548936e7d53f2a7..bc93aa4e46fc3db59e17434fdfc490bf81e9eccd 100644 (file)
--- a/mm/zbud.c
+++ b/mm/zbud.c
@@ -243,7 +243,7 @@ static struct zbud_header *init_zbud_page(struct page *page)
        zhdr->last_chunks = 0;
        INIT_LIST_HEAD(&zhdr->buddy);
        INIT_LIST_HEAD(&zhdr->lru);
-       zhdr->under_reclaim = 0;
+       zhdr->under_reclaim = false;
        return zhdr;
 }