From patchwork Thu Apr 14 11:49:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12813378 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 9EF36C433FE for ; Thu, 14 Apr 2022 11:49:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1BF686B0074; Thu, 14 Apr 2022 07:49:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 16EE26B0075; Thu, 14 Apr 2022 07:49:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EDB2D6B0078; Thu, 14 Apr 2022 07:49:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id E12306B0074 for ; Thu, 14 Apr 2022 07:49:20 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id BDDA0629A2 for ; Thu, 14 Apr 2022 11:49:20 +0000 (UTC) X-FDA: 79355314080.10.6EB9724 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf04.hostedemail.com (Postfix) with ESMTP id C549540003 for ; Thu, 14 Apr 2022 11:49:18 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4KfHgp5yW9zCr2d; Thu, 14 Apr 2022 19:44:54 +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, 14 Apr 2022 19:49:13 +0800 From: Miaohe Lin To: , CC: , , , , Subject: [PATCH v2 1/2] mm/memory-failure.c: minor cleanup for HWPoisonHandlable Date: Thu, 14 Apr 2022 19:49:40 +0800 Message-ID: <20220414114941.11223-2-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220414114941.11223-1-linmiaohe@huawei.com> References: <20220414114941.11223-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Stat-Signature: kytee4jenqqtsjaxkpq9yce8f1wyemap Authentication-Results: imf04.hostedemail.com; dkim=none; spf=pass (imf04.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspam-User: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: C549540003 X-HE-Tag: 1649936958-676613 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 e3fbff5bd467..488aaca72340 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1179,13 +1179,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)