Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1329244lqj; Mon, 3 Jun 2024 19:17:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWT05etMCJP6PEiTfCi5pi0A3AkJ6dkBMX2OZFUYImPlcc5k32l3H0KezRiey4IjV5hJuWZJuEwHG/Z2aySY9xlE2f7hqQvX1wTOJmfzw== X-Google-Smtp-Source: AGHT+IEXDR/W5uv0Wsj+2Uh60JXIdZISVfrhFHLUCpbx8ynJgZbo608++UCKTWgm6vLVOa/oU686 X-Received: by 2002:a05:6359:d12:b0:192:9d45:7921 with SMTP id e5c5f4694b2df-19b48c53d33mr1142853155d.4.1717467454599; Mon, 03 Jun 2024 19:17:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717467454; cv=pass; d=google.com; s=arc-20160816; b=FtDsk+Sx5fZonfdAGAXL0QuLIhD/+A21bjx+cs52UM0n9qtjRPCko4NNTqcDiDTXul tXmE7y+69y3hctpkypTSSsYY9j3SRCMVENrtrwbUGYGLJeRpRcAjVPSHndq+T6CxMqC4 VaOUgVERPMaIXQWTHphU/YSI8GW59zJkfTfaI/hlWL62Sh5T2QL/pmJUAIWzFB3CSxRq k0Xp+IynTiLt0mui6NeOlq1RBBpTugZ9fY/WgjSzAnySOyPY3tfvMRHcXGnpCrsHLBG5 iM3kLaUDYTIdEFUds5mrEYLTarxuOUVEPZWNZ9Z43/sHUlQnM8sLa54Tc171PJ/Gtm8G u6NQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=4viyx+5/MhDrBhC21NpZ0riI/T+dQ13EIY/JJGG63RA=; fh=sFKXENKXfj6O0FmDSMJWR6Hywno/suHnKLTgvDHpDig=; b=tuE6E5dorFvnPLECgE8A8tLrHtQCIAO1Y9SVJeL05T3Ci2ol56Nc18dclboy0i5EZZ +NQhHBrg8ArSxpT24jL/sLLfVSb0PsBMwzV5TFVBtq43EtXFUxE9ByPNNpe5Xb+A39NM sa+nARSVv0c+Ia+iqXgZCV7MLD3fgVydApHRVccIy/yK8a9UYtazoPVetN/gsr8QAwJX epLf7nZvPc+rMGRIQ6HPPBlGZz7Nf8QekxKJrlqN4pzJu1F9FGHanYsfuhwEAkD22tW8 MfNMVdFjmWLRQbTDfXs7Zm54IMYCwmm9XulQm4llcOaDOd001tioT6XhCFQwO0Jgl5W8 rH/Q==; 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-199958-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199958-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c35d694a59si7367181a12.806.2024.06.03.19.17.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 19:17:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199958-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; 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-199958-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199958-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 2605C28E87B for ; Tue, 4 Jun 2024 02:09:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ADFDA13D2BF; Tue, 4 Jun 2024 02:09:47 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 052411E485 for ; Tue, 4 Jun 2024 02:09:43 +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=1717466987; cv=none; b=HAPoEJ69EWbevt083W+dZc+pNqvYwAu3uytm/qSQQ9eew7NwzX61plABJqNpC/3/now58C+tg+NYB3vpacGQOyCpJpFKIuLT6AZJjqtO5AyRl3onACWP0SK78w++VfAzIN9tevyNvWnexJXXbX6LL46Bs3tlT+Ww1x2N9WHk8BI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717466987; c=relaxed/simple; bh=hwvOZyv7/mIIoFPw5rwuqHls+HkrfuvtmKl9JDFGQiU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=l/jTbJ58dcPIlgN2xKkPTKFMtxjBRRbnguwgw456IIKq1kfFRRq6nsg8Ej1zhf2R65kI6G8b99oT9NlAb/0gVHEfBWoMKDGeA473yILx0xH27One74LV5j1Ek0gjvb2wxHlLspMOTrsQJ7Y9AuQoBTNUoyeUmvflD9R4ivr/WJA= 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 627C81042; Mon, 3 Jun 2024 19:10:07 -0700 (PDT) Received: from [10.162.40.15] (a077893.blr.arm.com [10.162.40.15]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8A6B63F792; Mon, 3 Jun 2024 19:09:41 -0700 (PDT) Message-ID: <52773c75-916a-42df-b60f-531770a3cc82@arm.com> Date: Tue, 4 Jun 2024 07:39:38 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mm: sparse: Consistently use _nr Content-Language: en-US To: Dev Jain , akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20240531124144.240399-1-dev.jain@arm.com> From: Anshuman Khandual In-Reply-To: <20240531124144.240399-1-dev.jain@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 5/31/24 18:11, Dev Jain wrote: > 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 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); > } > } > }