From patchwork Fri Mar 6 10:19:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenqiwu X-Patchwork-Id: 11423451 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8BA4C14BC for ; Fri, 6 Mar 2020 10:19:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5843B2070A for ; Fri, 6 Mar 2020 10:19:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WTbCZfbg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5843B2070A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7D29A6B0005; Fri, 6 Mar 2020 05:19:40 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 780BC6B0006; Fri, 6 Mar 2020 05:19:40 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 697A86B0007; Fri, 6 Mar 2020 05:19:40 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0158.hostedemail.com [216.40.44.158]) by kanga.kvack.org (Postfix) with ESMTP id 532A06B0005 for ; Fri, 6 Mar 2020 05:19:40 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 0E4AE180AD806 for ; Fri, 6 Mar 2020 10:19:40 +0000 (UTC) X-FDA: 76564540920.26.pie80_8e934abd72f25 X-Spam-Summary: 2,0,0,430cada49976386e,d41d8cd98f00b204,qiwuchen55@gmail.com,,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1345:1437:1534:1541:1711:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3352:3866:4321:5007:6114:6261:6642:6653:7576:9036:9413:10004:11026:11473:11658:11914:12043:12297:12438:12517:12519:12555:12679:12895:12986:13069:13311:13357:14096:14181:14384:14394:14721:21080:21444:21451:21627:21666:21990:30012:30054,0,RBL:209.85.216.65:@gmail.com:.lbl8.mailshell.net-66.100.201.100 62.50.0.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: pie80_8e934abd72f25 X-Filterd-Recvd-Size: 3545 Received: from mail-pj1-f65.google.com (mail-pj1-f65.google.com [209.85.216.65]) by imf45.hostedemail.com (Postfix) with ESMTP for ; Fri, 6 Mar 2020 10:19:39 +0000 (UTC) Received: by mail-pj1-f65.google.com with SMTP id l8so877963pjy.1 for ; Fri, 06 Mar 2020 02:19:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=fH+7f7ZDpnYDHRoJGaTbSwN04XVdSqWPEjpPxwyA8O0=; b=WTbCZfbg68DOjGTLiVFfjmxV2Y7luqC8cyiO+tR1/qbF9tDeBReyHOfcvmU/P9sWEf 94P3+GhVu4p8TKe1/KKN/49V1wlnT8BwOEgToqxoyQHl1lUfGBMYrNkJHEdCTr7yt0JO i532pWX3Kv0mBtYrah5agcoIwD6FbAUasGCbvn6Uv4x9208dqhh4dJdLIR6b0JPuwg2s 8Jh0dVJs8wL/gDaDC9ad/w7A9oUHOVsYBNgBZ+ELjjz7thugbEEAetmgCIoasPh7Xu9q pHc4YY69n7P1kU04eYN54Ye4xOumnZeUAFBdr4LOd1knxofBCVyJv300n9CUf2hNk1vL NQbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=fH+7f7ZDpnYDHRoJGaTbSwN04XVdSqWPEjpPxwyA8O0=; b=jdIPcw6132vtn2qFb5grOwtzJhbg2MhmLAsFmxQ2zWvcfTeFVWl9qzWWgRDJeA+n1H lcOCYie+SlznExDoMbOtoHdiWhTf267GzgLfImDYY+42rIGeygzCyiH7jBfGscxOZJYK Ig+5U6ObUjMEBxDqUFIcMFsyzfFkRbEcQ/T2jhlWdXakUzSi458MKmhJy3cGwBtfIWCj 8RFU4cKdZ/2mN3FNeJmeMIIiq38gmlgPD/z9i7epl8Ubcc82poOztkvqWAx3w44A6Mfc WfEmxT6B4TsYzquiSAGIQkCM4m6bb4ajmUMxX5/xNZpAekF+JBqHxQpOCvOE1cBFWJDE RawQ== X-Gm-Message-State: ANhLgQ0iI0YdpmQQj8wVqPoc8gG2N+7EIgNSHwRoWSDO9wfZgI9bkss2 tk0ZQzGKHt3tSqGt31eieQg= X-Google-Smtp-Source: ADFU+vurZF/cOA4SbZitMh4R0QMtD8R1E0L5RQ1mK5G65SeDa6HCnZKUkM2Hjtnmt8KWM7LrBjEgBA== X-Received: by 2002:a17:902:7687:: with SMTP id m7mr2325006pll.136.1583489978561; Fri, 06 Mar 2020 02:19:38 -0800 (PST) Received: from localhost ([43.224.245.179]) by smtp.gmail.com with ESMTPSA id b27sm34759296pgl.77.2020.03.06.02.19.37 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 06 Mar 2020 02:19:37 -0800 (PST) From: qiwuchen55@gmail.com To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, chenqiwu Subject: [RESEND PATCH] mm/sparsemem: use wrapped macros instead of open-coding Date: Fri, 6 Mar 2020 18:19:26 +0800 Message-Id: <1583489966-16390-1-git-send-email-qiwuchen55@gmail.com> X-Mailer: git-send-email 1.9.1 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000003, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: chenqiwu Use wrapped macros instead of open-coding for better code readability. Signed-off-by: chenqiwu --- mm/sparse.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/sparse.c b/mm/sparse.c index 42c18a3..9b14164 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -385,8 +385,8 @@ static void __init check_usemap_section_nr(int nid, old_pgdat_snr = NR_MEM_SECTIONS; } - usemap_snr = pfn_to_section_nr(__pa(usage) >> PAGE_SHIFT); - pgdat_snr = pfn_to_section_nr(__pa(pgdat) >> PAGE_SHIFT); + usemap_snr = pfn_to_section_nr(virt_to_pfn(usage)); + pgdat_snr = pfn_to_section_nr(virt_to_pfn(pgdat)); if (usemap_snr == pgdat_snr) return; @@ -677,7 +677,7 @@ struct page * __meminit populate_section_memmap(unsigned long pfn, return NULL; got_map_page: - ret = (struct page *)pfn_to_kaddr(page_to_pfn(page)); + ret = (struct page *)page_to_virt(page); got_map_ptr: return ret;