From mboxrd@z Thu Jan 1 00:00:00 1970 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 59921C433EF for ; Tue, 28 Jun 2022 13:29:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 35D258E0011; Tue, 28 Jun 2022 09:28:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 29DBF8E000D; Tue, 28 Jun 2022 09:28:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0C5ED8E0011; Tue, 28 Jun 2022 09:28:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id D958F8E0010 for ; Tue, 28 Jun 2022 09:28:50 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id AF85F34940 for ; Tue, 28 Jun 2022 13:28:50 +0000 (UTC) X-FDA: 79627724820.01.69E1A8F Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf17.hostedemail.com (Postfix) with ESMTP id D4C0240031 for ; Tue, 28 Jun 2022 13:28:49 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4LXQPW3RbYzkX2G; Tue, 28 Jun 2022 21:27:27 +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; Tue, 28 Jun 2022 21:28:46 +0800 From: Miaohe Lin To: CC: , , , , , , Subject: [PATCH v2 16/16] mm/huge_memory: use helper macro IS_ERR_OR_NULL in split_huge_pages_pid Date: Tue, 28 Jun 2022 21:28:35 +0800 Message-ID: <20220628132835.8925-17-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220628132835.8925-1-linmiaohe@huawei.com> References: <20220628132835.8925-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656422930; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v9O1zeh5Ckq8WNu7To2V4yg0JhSvSIj/fHLqw48O09w=; b=WSKMXn7GVEj6qJ8j9nBar884NYWLUfmjsa/JZr9LNuERtyYQwTbVh6KkKOjW033udakvBz BubwgFPQ/i9qCAwvSAqryi6xWPrc24Gs7BQJppwCuOxN6UFwrmVGlI6KVjGNc3GVoDi42P dElj7BESdkJyDT1MTDZvqq+hcYsvH8Q= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=none; spf=pass (imf17.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656422930; a=rsa-sha256; cv=none; b=arvXkoNiljes/WPV0+HiFrFp6Vi3Gjerrp1Pr8w5uPI1lyz3hf5AjNsK7+prfawmDmsjc8 fjKyonvJV6jfbhOO/HmatZ4PAYojKsT8pxyV1H3eTX5Sqitj5A5J2rLysDi5XcHky5RBna az4g9QLeQluJ3DO0BexG8Akg3pdszIw= Authentication-Results: imf17.hostedemail.com; dkim=none; spf=pass (imf17.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspam-User: X-Rspamd-Server: rspam06 X-Stat-Signature: o37kngoc6yddqqqy61fz5ed4jdmz6cgs X-Rspamd-Queue-Id: D4C0240031 X-HE-Tag: 1656422929-946322 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: Use helper macro IS_ERR_OR_NULL to check the validity of page to simplify the code. Minor readability improvement. Signed-off-by: Miaohe Lin --- mm/huge_memory.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 1d32349a95f4..b406fe08b2c9 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -3057,9 +3057,7 @@ static int split_huge_pages_pid(int pid, unsigned long vaddr_start, /* FOLL_DUMP to ignore special (like zero) pages */ page = follow_page(vma, addr, FOLL_GET | FOLL_DUMP | FOLL_LRU); - if (IS_ERR(page)) - continue; - if (!page) + if (IS_ERR_OR_NULL(page)) continue; if (!is_transparent_hugepage(page)) -- 2.23.0