From patchwork Thu Apr 7 13:03:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12805219 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94609C433F5 for ; Thu, 7 Apr 2022 13:04:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ABE916B0071; Thu, 7 Apr 2022 09:03:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7B4296B0073; Thu, 7 Apr 2022 09:03:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4CDDB6B0074; Thu, 7 Apr 2022 09:03:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0126.hostedemail.com [216.40.44.126]) by kanga.kvack.org (Postfix) with ESMTP id 3126F6B0073 for ; Thu, 7 Apr 2022 09:03:38 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id DEE011809FDF6 for ; Thu, 7 Apr 2022 13:03:27 +0000 (UTC) X-FDA: 79330099254.28.FA64AFE Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf23.hostedemail.com (Postfix) with ESMTP id 34893140014 for ; Thu, 7 Apr 2022 13:03:27 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4KZ1l31llVz1HBd3; Thu, 7 Apr 2022 21:02:55 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 7 Apr 2022 21:03:22 +0800 From: Miaohe Lin To: , CC: , , , , , Subject: [PATCH 2/3] mm/memory-failure.c: minor cleanup for HWPoisonHandlable Date: Thu, 7 Apr 2022 21:03:51 +0800 Message-ID: <20220407130352.15618-3-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220407130352.15618-1-linmiaohe@huawei.com> References: <20220407130352.15618-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Rspam-User: Authentication-Results: imf23.hostedemail.com; dkim=none; spf=pass (imf23.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 34893140014 X-Stat-Signature: 83jw6aqb8zue74py47o8mkcis75k6om9 X-HE-Tag: 1649336607-119287 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: The local variable movable can be removed by returning true directly. Also fix typo 'mirgate'. No functional change intended. Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Yang Shi Acked-by: Naoya Horiguchi --- mm/memory-failure.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 2e97302d62e4..bd563f47630c 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1180,13 +1180,11 @@ void ClearPageHWPoisonTakenOff(struct page *page) */ static inline bool HWPoisonHandlable(struct page *page, unsigned long flags) { - bool movable = false; - - /* Soft offline could mirgate non-LRU movable pages */ + /* Soft offline could migrate non-LRU movable pages */ if ((flags & MF_SOFT_OFFLINE) && __PageMovable(page)) - movable = true; + return true; - return movable || PageLRU(page) || is_free_buddy_page(page); + return PageLRU(page) || is_free_buddy_page(page); } static int __get_hwpoison_page(struct page *page, unsigned long flags)