From nobody Fri Feb 13 06:07:15 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B41BA155C94 for ; Fri, 31 May 2024 12:42:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717159325; cv=none; b=bFJZniK40NkImmOilJclAHRVunCLPE4C3xE1no7PDNZY2eg059FcBM6QhhD97wkVwmdYj/lbY5DASfgnzcdRrp8/iJaa3yxgKmAh7eFTd9M2T75SLVeqERxn6KxedmZFIR8xySu3SemvE0G6OIBW3I5IYs9ptY9kh/bBGjW0k3w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717159325; c=relaxed/simple; bh=hZtLtDq3z1qzw0IqqgNSz0ZkCA2NrxCX/CKkC0yeM24=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=IA9Jvzp+mDS/x8gYJwt/md4VxmQ7MVQfnlnasp5yg9MTY2wAnWZJlzQ/d/oE1MEOrtp1Zd4O/9s/UJ+SlYlOjPMuh3fFoIiSOWzcHlaW4ZPkh6MpDNXdqRAUxm12B32pdUVc7BYCYa5XDOuXPTkkjOPngv3nJS+WylJRCCLmLDo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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, u= nsigned long pfn, =20 void __init subsection_map_init(unsigned long pfn, unsigned long nr_pages) { - int end_sec =3D pfn_to_section_nr(pfn + nr_pages - 1); - unsigned long nr, start_sec =3D pfn_to_section_nr(pfn); + int end_sec_nr =3D pfn_to_section_nr(pfn + nr_pages - 1); + unsigned long nr, start_sec_nr =3D pfn_to_section_nr(pfn); =20 if (!nr_pages) return; =20 - for (nr =3D start_sec; nr <=3D end_sec; nr++) { + for (nr =3D start_sec_nr; nr <=3D end_sec_nr; nr++) { struct mem_section *ms; unsigned long pfns; =20 @@ -229,17 +229,17 @@ static void __init memory_present(int nid, unsigned l= ong start, unsigned long en start &=3D PAGE_SECTION_MASK; mminit_validate_memmodel_limits(&start, &end); for (pfn =3D start; pfn < end; pfn +=3D PAGES_PER_SECTION) { - unsigned long section =3D pfn_to_section_nr(pfn); + unsigned long section_nr =3D pfn_to_section_nr(pfn); struct mem_section *ms; =20 - sparse_index_init(section, nid); - set_section_nid(section, nid); + sparse_index_init(section_nr, nid); + set_section_nid(section_nr, nid); =20 - ms =3D __nr_to_section(section); + ms =3D __nr_to_section(section_nr); if (!ms->section_mem_map) { ms->section_mem_map =3D sparse_encode_early_nid(nid) | SECTION_IS_ONLINE; - __section_mark_present(ms, section); + __section_mark_present(ms, section_nr); } } } --=20 2.30.2