From patchwork Wed Jul 7 15:02:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?6raM7Jik7ZuI?= X-Patchwork-Id: 12362763 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=-20.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham 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 0CDD3C07E9E for ; Wed, 7 Jul 2021 15:05:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9B39961CC0 for ; Wed, 7 Jul 2021 15:05:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9B39961CC0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D25226B005D; Wed, 7 Jul 2021 11:05:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CFBD36B0072; Wed, 7 Jul 2021 11:05:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B89856B005D; Wed, 7 Jul 2021 11:05:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0117.hostedemail.com [216.40.44.117]) by kanga.kvack.org (Postfix) with ESMTP id 9576F6B005D for ; Wed, 7 Jul 2021 11:05:45 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id CA59418F5D for ; Wed, 7 Jul 2021 15:05:44 +0000 (UTC) X-FDA: 78336116208.08.F0A4FD7 Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by imf29.hostedemail.com (Postfix) with ESMTP id BD6319000252 for ; Wed, 7 Jul 2021 15:05:43 +0000 (UTC) Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20210707150540epoutp027407f55fd3d69907e287ac44b167dd87~Pio-dJleV1849818498epoutp026 for ; Wed, 7 Jul 2021 15:05:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20210707150540epoutp027407f55fd3d69907e287ac44b167dd87~Pio-dJleV1849818498epoutp026 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1625670341; bh=P5M8iJ0a8JoZjAfb3+Emp7S0S3yFYTSdXdTiNiKaSQ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oz2EID+NPPci3E7yui3aLjzoaF6bbmqpI6qTE2kW9akurRAH6IWDqCTZ6escq44iZ YzDNki4jFEUwgS9JDRwy+288rTLxggSTjyAyTf087P0RM2e6iF4oIcCm+pKfLkAo0p aHobp6FEF89CNS2BfMtO2jV6dB4u5BIp5Spmt4GU= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20210707150540epcas1p35127497ebc4c06bea2994816587d02b1~Pio-DHeUO2341123411epcas1p3Y; Wed, 7 Jul 2021 15:05:40 +0000 (GMT) Received: from epsmges1p5.samsung.com (unknown [182.195.40.166]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4GKjR732q2z4x9Pv; Wed, 7 Jul 2021 15:05:39 +0000 (GMT) Received: from epcas1p3.samsung.com ( [182.195.41.47]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id 77.86.09586.3C2C5E06; Thu, 8 Jul 2021 00:05:39 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas1p1.samsung.com (KnoxPortal) with ESMTPA id 20210707150538epcas1p149f866bf9b4c900a091c006df7162a23~Pio9gHBUq2525925259epcas1p1B; Wed, 7 Jul 2021 15:05:38 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20210707150538epsmtrp2e431a65e97bd64b1b1f3fcdea03c8936~Pio9dxCx_0232302323epsmtrp2W; Wed, 7 Jul 2021 15:05:38 +0000 (GMT) X-AuditID: b6c32a39-86dff70000002572-ee-60e5c2c3f8b7 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id B3.E7.08394.2C2C5E06; Thu, 8 Jul 2021 00:05:38 +0900 (KST) Received: from localhost.localdomain (unknown [10.253.98.78]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210707150538epsmtip21326e8759022e7ff91c8dc79645e971f~Pio9W6_ob1222712227epsmtip2N; Wed, 7 Jul 2021 15:05:38 +0000 (GMT) From: Ohhoon Kwon To: david@redhat.com, ohoono.kwon@samsung.com, akpm@linux-foundation.org, mhocko@suse.com Cc: bhe@redhat.com, rppt@linux.ibm.com, ohkwon1043@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 3/3] mm: sparse: remove __section_nr() function Date: Thu, 8 Jul 2021 00:02:12 +0900 Message-Id: <20210707150212.855-4-ohoono.kwon@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210707150212.855-1-ohoono.kwon@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrEKsWRmVeSWpSXmKPExsWy7bCmvu7hQ08TD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44DSizFGYmGWsxFxYkAOpX8Wb0C AAA= X-CMS-MailID: 20210707150538epcas1p149f866bf9b4c900a091c006df7162a23 X-Msg-Generator: CA X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210707150538epcas1p149f866bf9b4c900a091c006df7162a23 References: <20210707150212.855-1-ohoono.kwon@samsung.com> Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=oz2EID+N; spf=pass (imf29.hostedemail.com: domain of ohoono.kwon@samsung.com designates 203.254.224.25 as permitted sender) smtp.mailfrom=ohoono.kwon@samsung.com; dmarc=pass (policy=none) header.from=samsung.com X-Stat-Signature: zy71tu6z6744apzgetcisy8q1bz17iyh X-Rspamd-Queue-Id: BD6319000252 X-Rspamd-Server: rspam06 X-HE-Tag: 1625670343-136057 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: As the last users of __section_nr() are gone, let's remove unused function __section_nr(). Signed-off-by: Ohhoon Kwon Acked-by: Michal Hocko Acked-by: Mike Rapoport Reviewed-by: David Hildenbrand --- include/linux/mmzone.h | 1 - mm/sparse.c | 26 -------------------------- 2 files changed, 27 deletions(-) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index fcb535560028..8827f4d081d4 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -1342,7 +1342,6 @@ static inline struct mem_section *__nr_to_section(unsigned long nr) return NULL; return &mem_section[SECTION_NR_TO_ROOT(nr)][nr & SECTION_ROOT_MASK]; } -extern unsigned long __section_nr(struct mem_section *ms); extern size_t mem_section_usage_size(void); /* diff --git a/mm/sparse.c b/mm/sparse.c index 8018ee7fcda5..d85655242ed9 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -109,32 +109,6 @@ static inline int sparse_index_init(unsigned long section_nr, int nid) } #endif -#ifdef CONFIG_SPARSEMEM_EXTREME -unsigned long __section_nr(struct mem_section *ms) -{ - unsigned long root_nr; - struct mem_section *root = NULL; - - for (root_nr = 0; root_nr < NR_SECTION_ROOTS; root_nr++) { - root = __nr_to_section(root_nr * SECTIONS_PER_ROOT); - if (!root) - continue; - - if ((ms >= root) && (ms < (root + SECTIONS_PER_ROOT))) - break; - } - - VM_BUG_ON(!root); - - return (root_nr * SECTIONS_PER_ROOT) + (ms - root); -} -#else -unsigned long __section_nr(struct mem_section *ms) -{ - return (unsigned long)(ms - mem_section[0]); -} -#endif - /* * During early boot, before section_mem_map is used for an actual * mem_map, we use section_mem_map to store the section's NUMA