From patchwork Thu Sep 2 21:57:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12473093 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 66582C433F5 for ; Thu, 2 Sep 2021 21:57:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 19168603E9 for ; Thu, 2 Sep 2021 21:57:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 19168603E9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id AE7DC6B012F; Thu, 2 Sep 2021 17:57:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A973F6B0130; Thu, 2 Sep 2021 17:57:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9ADD98D0001; Thu, 2 Sep 2021 17:57:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0141.hostedemail.com [216.40.44.141]) by kanga.kvack.org (Postfix) with ESMTP id 8B5016B012F for ; Thu, 2 Sep 2021 17:57:06 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 558C12B37E for ; Thu, 2 Sep 2021 21:57:06 +0000 (UTC) X-FDA: 78543994452.09.917DD53 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf17.hostedemail.com (Postfix) with ESMTP id 0EAC3F00038C for ; Thu, 2 Sep 2021 21:57:05 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 0999260E8B; Thu, 2 Sep 2021 21:57:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1630619825; bh=702ZXylp8++uRznDT57BajIwC366b3r4RkMeHYSL64A=; h=Date:From:To:Subject:In-Reply-To:From; b=Q3ZhH9JvHPgBVTTBryAX427mI5aPLZlObInhv3WlRnnWiZNdp8/Dz3Qy4iwHpfOg5 bv72n3e92dtnCJ5syNva/imzbiu0K8KQjDv0iIHj30rQcqMpaplW3LCr+tt219jhQ+ Snz3ZmcLY8xGOvI/CkY6dHR1KmK9ZlLnCvDfvR20= Date: Thu, 02 Sep 2021 14:57:04 -0700 From: Andrew Morton To: akpm@linux-foundation.org, bhe@redhat.com, david@redhat.com, linux-mm@kvack.org, mhocko@suse.com, mm-commits@vger.kernel.org, ohoono.kwon@samsung.com, rppt@linux.ibm.com, torvalds@linux-foundation.org Subject: [patch 133/212] mm: sparse: remove __section_nr() function Message-ID: <20210902215704._ats9uMt7%akpm@linux-foundation.org> In-Reply-To: <20210902144820.78957dff93d7bea620d55a89@linux-foundation.org> User-Agent: s-nail v14.8.16 Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=Q3ZhH9Jv; dmarc=none; spf=pass (imf17.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 0EAC3F00038C X-Stat-Signature: 8kd35ae4kqedxj9p63anatrnkog19tkz X-HE-Tag: 1630619825-87334 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: From: Ohhoon Kwon Subject: mm: sparse: remove __section_nr() function As the last users of __section_nr() are gone, let's remove unused function __section_nr(). Link: https://lkml.kernel.org/r/20210707150212.855-4-ohoono.kwon@samsung.com Signed-off-by: Ohhoon Kwon Acked-by: Michal Hocko Acked-by: Mike Rapoport Reviewed-by: David Hildenbrand Cc: Baoquan He Signed-off-by: Andrew Morton --- include/linux/mmzone.h | 1 - mm/sparse.c | 26 -------------------------- 2 files changed, 27 deletions(-) --- a/include/linux/mmzone.h~mm-sparse-remove-__section_nr-function +++ a/include/linux/mmzone.h @@ -1342,7 +1342,6 @@ static inline struct mem_section *__nr_t 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); /* --- a/mm/sparse.c~mm-sparse-remove-__section_nr-function +++ a/mm/sparse.c @@ -109,32 +109,6 @@ static inline int sparse_index_init(unsi } #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