mm: memcontrol: sssign boolean values to a bool variable
authorKaixu Xia <kaixuxia@tencent.com>
Tue, 15 Dec 2020 03:07:07 +0000 (19:07 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 15 Dec 2020 20:13:40 +0000 (12:13 -0800)
Fix the following coccinelle warnings:

  mm/memcontrol.c:7341:2-22: WARNING: Assignment of 0/1 to bool variable
  mm/memcontrol.c:7343:2-22: WARNING: Assignment of 0/1 to bool variable

Link: https://lkml.kernel.org/r/1604737495-6418-1-git-send-email-kaixuxia@tencent.com
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
Reported-by: Tosk Robot <tencent_os_robot@tencent.com>
Acked-by: Souptick Joarder <jrdr.linux@gmail.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memcontrol.c

index b50f7f3..13e3869 100644 (file)
@@ -7262,9 +7262,9 @@ bool mem_cgroup_swap_full(struct page *page)
 static int __init setup_swap_account(char *s)
 {
        if (!strcmp(s, "1"))
-               cgroup_memory_noswap = 0;
+               cgroup_memory_noswap = false;
        else if (!strcmp(s, "0"))
-               cgroup_memory_noswap = 1;
+               cgroup_memory_noswap = true;
        return 1;
 }
 __setup("swapaccount=", setup_swap_account);