From patchwork Wed Sep 8 22:18:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12481885 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B54B6C433FE for ; Wed, 8 Sep 2021 22:18:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5FE9560F5B for ; Wed, 8 Sep 2021 22:18:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5FE9560F5B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id F22E36B0075; Wed, 8 Sep 2021 18:18:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ED2306B0078; Wed, 8 Sep 2021 18:18:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D7228900002; Wed, 8 Sep 2021 18:18:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0186.hostedemail.com [216.40.44.186]) by kanga.kvack.org (Postfix) with ESMTP id C46916B0075 for ; Wed, 8 Sep 2021 18:18:08 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 7687D2D3B4 for ; Wed, 8 Sep 2021 22:18:08 +0000 (UTC) X-FDA: 78565820256.29.E3A6D9D Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf08.hostedemail.com (Postfix) with ESMTP id 3334A30000A8 for ; Wed, 8 Sep 2021 22:18:08 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 4902D61158; Wed, 8 Sep 2021 22:18:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1631139487; bh=IE2T/nyosoJXWfsmb0XZvS0qfX+7nvspqvMr4iz9ZMA=; h=Date:From:To:Subject:In-Reply-To:From; b=fYwHHHWF/RrK3iSq2Wmecc8rO0VEmPKZa73FZNAx3WbR3prM/1xkOetuXeVnOvNNC fOht83CjDiPUAuKTsDjEar2vvviC0Cpi5/FPcww0MwrEqekaVWNcPwsT7AnqiKf8zL +bVY0tKM5aj7XMqs0d78OAro+lNReO3TYl0551b8= Date: Wed, 08 Sep 2021 15:18:06 -0700 From: Andrew Morton To: akpm@linux-foundation.org, apopple@nvidia.com, baolin.wang@linux.alibaba.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, shy828301@gmail.com, torvalds@linux-foundation.org, willy@infradead.org Subject: [patch 04/10] mm: migrate: change to use bool type for 'page_was_mapped' Message-ID: <20210908221806.ykzxWtvhy%akpm@linux-foundation.org> In-Reply-To: <20210908151729.c9a15a9508ba0aed22289c76@linux-foundation.org> User-Agent: s-nail v14.8.16 Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=fYwHHHWF; spf=pass (imf08.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Stat-Signature: y3b8ndq648nqqjwdjfnqjaj96xauedwr X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 3334A30000A8 X-HE-Tag: 1631139488-156748 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Baolin Wang Subject: mm: migrate: change to use bool type for 'page_was_mapped' Change to use bool type for 'page_was_mapped' variable making it more readable. Link: https://lkml.kernel.org/r/ce1279df18d2c163998c403e0b5ec6d3f6f90f7a.1629447552.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Reviewed-by: Yang Shi Cc: Alistair Popple Cc: Matthew Wilcox Signed-off-by: Andrew Morton --- mm/migrate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/mm/migrate.c~mm-migrate-change-to-use-bool-type-for-page_was_mapped +++ a/mm/migrate.c @@ -960,7 +960,7 @@ static int __unmap_and_move(struct page int force, enum migrate_mode mode) { int rc = -EAGAIN; - int page_was_mapped = 0; + bool page_was_mapped = false; struct anon_vma *anon_vma = NULL; bool is_lru = !__PageMovable(page); @@ -1063,7 +1063,7 @@ static int __unmap_and_move(struct page VM_BUG_ON_PAGE(PageAnon(page) && !PageKsm(page) && !anon_vma, page); try_to_migrate(page, 0); - page_was_mapped = 1; + page_was_mapped = true; } if (!page_mapped(page))