Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp418882lqh; Fri, 31 May 2024 05:42:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU/nnXDF7SPyHW5WhF7sPYBl+p4oHArrtR3jNGD57V/LN1hUNeLKLLZbiQzc2IqFKHlgPsnUnFb9ZRGty5O9OJ0MrlnQjU17uZ3aMFoJw== X-Google-Smtp-Source: AGHT+IGTzq2gMw2WO5b2VhXrCidQdSosWOnjZPMXP5n5Qv6hzG245KclIR0ijuYqgQ0eK1T5pjR+ X-Received: by 2002:a81:a806:0:b0:627:7630:800a with SMTP id 00721157ae682-62c7983ca64mr15683507b3.49.1717159334083; Fri, 31 May 2024 05:42:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717159334; cv=pass; d=google.com; s=arc-20160816; b=dU5cG/aNfpzudTLRuWCEF8Kcu9pE1PJuAsrvtQFuvvCO9xINi6RaXEVQllLaqGf0WS YERLWCR/uASS7G2y9ZF7KEUesSB7Y7BcfcO8h8hTpZ1ZV7PkQNAhU/vin4JZz+iEYy/X KhYJPH2fJsJx7ukuql4fLsGmZIngAO5D7gORyvcabF/6i7IkSQzbxb6xYJt12rfx+/P1 6UiHwzwp25AyEVh403AcuY6Fwv+/hA7b63ggA4w2yF7jy1092o02MfPp6eL5BAZgY7qH nmKoMb7nlL1ZKVxqrwOfZ4g0cs5fCJ2mIkgJxy2qiD3CalCdVUj2Y2aFESEIKo1T+09M 7bWg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=INbadKVzbrye6wGnWHV3lKxqG5INjA8rTHjb+HAlrhQ=; fh=eQ1G6yEecoBWmZJRjfREMu5eHGBde61jj33r5/C3dQ4=; b=OwNTeziLBLpVTrVOYEvxqtCmDmX+yoXB/XDL98VhF80KvA1tiwJFegANQvgHQVFVLr 3eKJOVv2CBe5PfGhMiH2yeGZfqyTAwUwW6UpC3O4YK+KCVQM6exsuheD+Lv+RJjRpZqh 6xa9pFbtTgYeus6Enl4qjYaaqbt/LX9a11ef3WzIICyJWO7aRDhhAT8lYv2OOW+tKSbQ tHpFOtzGtlNOsfYmWr0y6y4ePUpfqN1ic6yoK3hj4315WOijQ7ru+XUbvAgmOhARlwWY j2dpJI8INwHLFxhn3agtBEV4sYDnw5aT4W6RCNXoStHZwphMUZfMgdrDt08c9M2neBFT jJ+w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-196813-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196813-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-794f3064f48si188067485a.297.2024.05.31.05.42.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 05:42:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-196813-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-196813-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196813-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C8DCB1C248F0 for ; Fri, 31 May 2024 12:42:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 00C6D1586F4; Fri, 31 May 2024 12:42:06 +0000 (UTC) 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: 8bit 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 --- 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); } } } -- 2.30.2