From patchwork Fri May 31 12:41:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dev Jain X-Patchwork-Id: 13681653 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 9478EC25B75 for ; Fri, 31 May 2024 12:42:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2A1116B00A2; Fri, 31 May 2024 08:42:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 250386B00A3; Fri, 31 May 2024 08:42:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 13F9A6B00A4; Fri, 31 May 2024 08:42:06 -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 EBFA76B00A2 for ; Fri, 31 May 2024 08:42:05 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 9E47B14036A for ; Fri, 31 May 2024 12:42:05 +0000 (UTC) X-FDA: 82178653410.02.3DDC14F Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf05.hostedemail.com (Postfix) with ESMTP id 23754100019 for ; Fri, 31 May 2024 12:42:03 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf05.hostedemail.com: domain of dev.jain@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=dev.jain@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717159324; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=INbadKVzbrye6wGnWHV3lKxqG5INjA8rTHjb+HAlrhQ=; b=jkGF9iFC+uEwvmbbBZn3fZXXDBIvOUqoJEw6VZftm2TVQkoqdDQdxt7OwzoUansCuhzg+c PWfVKcOTskGDsSAYmzgklPVfeBxKbeEvoBu5ULLwCnuZsQZzKmqxX8xRCgoAIGz/6JuMFL TaP4u7HCGIlpCVPJPLMNusVnhrnwJC0= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf05.hostedemail.com: domain of dev.jain@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=dev.jain@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717159324; a=rsa-sha256; cv=none; b=rAPbsEB7ApSS0o5ZlGbPbT/PsSYMcyXm2bdnHoZpwsb0+I7o5VXvYwOqn3PNFZtP1gkrAZ bt2m5On9rB03Uu5PRWT5ic4hXNIA+y5wHnbfDEB6UIX6j1JnSXAtCMbA9GpMA+XHLudD+9 d6pVPE6JLgvmRNn3twreRxhCJK0zjmw= Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 588231424; Fri, 31 May 2024 05:42:27 -0700 (PDT) Received: from e116581.blr.arm.com (e116581.arm.com [10.162.41.15]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id DE60B3F792; Fri, 31 May 2024 05:42:00 -0700 (PDT) From: Dev Jain To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Anshuman.Khandual@arm.com, Dev Jain Subject: [PATCH] mm: sparse: Consistently use _nr Date: Fri, 31 May 2024 18:11:44 +0530 Message-Id: <20240531124144.240399-1-dev.jain@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Rspam-User: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PtiNbFo8a iyQz7Q70 xCS9gPB+dD5M4t+ICHRzrm2IcIu3jwwcj2hCF7ss5SHdINqnQi/T6kUtQoJ5r9/um6sKA4aC0rqq0BUESvcyUgVySfQlvr5G7XzevQvKe4kDJNAEsADc17DLreuoLsEBp3ujYlD1tkrTIATB5e8ADs4hXfKyT2mtCWHY630vK+vT0LOvR6MzQMZJEIJcqSyfsM5jK+bFuFd2Ucf9anDlzvnFD3Cj6UFqTeA4205LoYCfI8xD+OHfquV5HFw== 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: List-Subscribe: List-Unsubscribe: Consistenly name the return variable with an _nr suffix, whenever calling pfn_to_section_nr(), to avoid confusion with a (struct mem_section *). Signed-off-by: Dev Jain Acked-by: Oscar Salvador Reviewed-by: Anshuman Khandual --- mm/sparse.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mm/sparse.c b/mm/sparse.c index de40b2c73406..731f781e91b6 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -192,13 +192,13 @@ static void subsection_mask_set(unsigned long *map, unsigned long pfn, void __init subsection_map_init(unsigned long pfn, unsigned long nr_pages) { - int end_sec = pfn_to_section_nr(pfn + nr_pages - 1); - unsigned long nr, start_sec = pfn_to_section_nr(pfn); + int end_sec_nr = pfn_to_section_nr(pfn + nr_pages - 1); + unsigned long nr, start_sec_nr = pfn_to_section_nr(pfn); if (!nr_pages) return; - for (nr = start_sec; nr <= end_sec; nr++) { + for (nr = start_sec_nr; nr <= end_sec_nr; nr++) { struct mem_section *ms; unsigned long pfns; @@ -229,17 +229,17 @@ static void __init memory_present(int nid, unsigned long start, unsigned long en start &= PAGE_SECTION_MASK; mminit_validate_memmodel_limits(&start, &end); for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION) { - unsigned long section = pfn_to_section_nr(pfn); + unsigned long section_nr = pfn_to_section_nr(pfn); struct mem_section *ms; - sparse_index_init(section, nid); - set_section_nid(section, nid); + sparse_index_init(section_nr, nid); + set_section_nid(section_nr, nid); - ms = __nr_to_section(section); + ms = __nr_to_section(section_nr); if (!ms->section_mem_map) { ms->section_mem_map = sparse_encode_early_nid(nid) | SECTION_IS_ONLINE; - __section_mark_present(ms, section); + __section_mark_present(ms, section_nr); } } }