From nobody Tue Apr 7 16:30:09 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E296ECAAD6 for ; Fri, 26 Aug 2022 09:25:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343695AbiHZJZB (ORCPT ); Fri, 26 Aug 2022 05:25:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245701AbiHZJYz (ORCPT ); Fri, 26 Aug 2022 05:24:55 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F8C63F306 for ; Fri, 26 Aug 2022 02:24:54 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MDZ8H329MzkWjG; Fri, 26 Aug 2022 17:21:19 +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; Fri, 26 Aug 2022 17:24:51 +0800 From: Miaohe Lin To: , , CC: , , Subject: [PATCH 01/10] hugetlb: make hugetlb_cma_check() static Date: Fri, 26 Aug 2022 17:24:13 +0800 Message-ID: <20220826092422.39591-2-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220826092422.39591-1-linmiaohe@huawei.com> References: <20220826092422.39591-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Make hugetlb_cma_check() static as it's only used inside mm/hugetlb.c. Signed-off-by: Miaohe Lin Reviewed-by: Muchun Song --- include/linux/hugetlb.h | 4 ---- mm/hugetlb.c | 10 +++++++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 852f911d676e..c2abbd7950de 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -1155,14 +1155,10 @@ static inline spinlock_t *huge_pte_lock(struct hsta= te *h, =20 #if defined(CONFIG_HUGETLB_PAGE) && defined(CONFIG_CMA) extern void __init hugetlb_cma_reserve(int order); -extern void __init hugetlb_cma_check(void); #else static inline __init void hugetlb_cma_reserve(int order) { } -static inline __init void hugetlb_cma_check(void) -{ -} #endif =20 bool want_pmd_share(struct vm_area_struct *vma, unsigned long addr); diff --git a/mm/hugetlb.c b/mm/hugetlb.c index f1dc80f47dd6..10d84abb1ca7 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -4058,6 +4058,14 @@ static void hugetlb_register_all_nodes(void) { } =20 #endif =20 +#ifdef CONFIG_CMA +static void __init hugetlb_cma_check(void); +#else +static inline __init void hugetlb_cma_check(void) +{ +} +#endif + static int __init hugetlb_init(void) { int i; @@ -7546,7 +7554,7 @@ void __init hugetlb_cma_reserve(int order) hugetlb_cma_size =3D 0; } =20 -void __init hugetlb_cma_check(void) +static void __init hugetlb_cma_check(void) { if (!hugetlb_cma_size || cma_reserve_called) return; --=20 2.23.0