Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp7531885ybh; Thu, 8 Aug 2019 18:05:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxtOz8Bh/nOlK7rh3nwsASMxOGsQFuxwCceRRYZ1p2Psop7uyiortSLtZZKU3n2HiPnlbM9 X-Received: by 2002:a63:7c0d:: with SMTP id x13mr15053467pgc.360.1565312701943; Thu, 08 Aug 2019 18:05:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565312701; cv=none; d=google.com; s=arc-20160816; b=jsHZnTLVO+zBypEQxer1KxItIylnYANaFbGzFpNx/8FLpWKJq3mUOeeARKbaL+fVTb x0Jr2pPgsbuZ/v2rBxq21a/2YY5ts+F4DJnMTXiD+u9eYA64uVv5JRr/WVsPkeVaddjA AV83xax2JprbQd2EhkthJFmS8oHb5YuB2hf00t33JQ4pNqPwNriqeOfGf3b96xkjHJfz EKniJ9JvQO/OVtiFdzJ2BB0EzMfcAdpapleu8ZMUMpeSJVPuVEw+32CwZYMT2WV942qb zGN/u0458VEMjyoo8uLgj2a52JmNCouXsmULE9McrxviAGfjY55YVWI0JCZdqkfkEz4W M4XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=SaBZ2/RBQvpEpBePzfeVnItopZgz55kiC8yX4ppg1kY=; b=WJJsaG7l3GRYMnZKDVAWZhO9wmyxJtT1EX5j9ZtprDaZM6GnRPSTuyrVxTwqIHfD8I w+sIGcYw0KOkvSNai89nAo8tIrTn5OPpLl+PXgpwxd/FxhJQ8YV4Xau1n5S7Y+lgy+3Q q2Ww2bSaGeAXyg5iJNFyFPjW9ntAWVIAiaKgv3f4TmJXLg9aNuskSpfppcdiVZZEFgfA Uy1uAwP+maqtsXlAI/VTs8xFiKW9gZCgAvPpOAH3i4NtHCgfkFLi7v+P9obn046yXJhy ovIX65+F47FDlhkiPkg0/N+jK8AeJugQP8oAMuHbl/iREN4slUwOUArxakRZPby3/MA7 458w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l66si20830799plb.337.2019.08.08.18.04.45; Thu, 08 Aug 2019 18:05:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405162AbfHIBDY (ORCPT + 99 others); Thu, 8 Aug 2019 21:03:24 -0400 Received: from mga12.intel.com ([192.55.52.136]:61498 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725785AbfHIBDY (ORCPT ); Thu, 8 Aug 2019 21:03:24 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Aug 2019 18:03:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,363,1559545200"; d="scan'208";a="350356786" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by orsmga005.jf.intel.com with ESMTP; 08 Aug 2019 18:03:22 -0700 From: Wei Yang To: akpm@linux-foundation.org, osalvador@suse.de, pasha.tatashin@oracle.com, mhocko@suse.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Wei Yang Subject: [PATCH] mm/sparse: use __nr_to_section(section_nr) to get mem_section Date: Fri, 9 Aug 2019 09:02:42 +0800 Message-Id: <20190809010242.29797-1-richardw.yang@linux.intel.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org __pfn_to_section is defined as __nr_to_section(pfn_to_section_nr(pfn)). Since we already get section_nr, it is not necessary to get mem_section from start_pfn. By doing so, we reduce one redundant operation. Signed-off-by: Wei Yang --- mm/sparse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/sparse.c b/mm/sparse.c index 72f010d9bff5..95158a148cd1 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -867,7 +867,7 @@ int __meminit sparse_add_section(int nid, unsigned long start_pfn, */ page_init_poison(pfn_to_page(start_pfn), sizeof(struct page) * nr_pages); - ms = __pfn_to_section(start_pfn); + ms = __nr_to_section(section_nr); set_section_nid(section_nr, nid); section_mark_present(ms); -- 2.17.1