From patchwork Mon Mar 16 07:52:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenqiwu X-Patchwork-Id: 11439867 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 16D16913 for ; Mon, 16 Mar 2020 07:52:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D6CCA20674 for ; Mon, 16 Mar 2020 07:52:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Q9hiVXE4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D6CCA20674 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 08A916B0003; Mon, 16 Mar 2020 03:52:22 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 03B6F6B0005; Mon, 16 Mar 2020 03:52:21 -0400 (EDT) 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 E92CB6B0007; Mon, 16 Mar 2020 03:52:21 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0066.hostedemail.com [216.40.44.66]) by kanga.kvack.org (Postfix) with ESMTP id CD6BE6B0003 for ; Mon, 16 Mar 2020 03:52:21 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id A066E9892 for ; Mon, 16 Mar 2020 07:52:21 +0000 (UTC) X-FDA: 76600457682.14.glove18_14956f076ea32 X-Spam-Summary: 2,0,0,a8bef03440d4e2e4,d41d8cd98f00b204,qiwuchen55@gmail.com,,RULES_HIT:41:355:379:541:800:960:968:973:988:989:1260:1345:1534:1539:1568:1711:1714:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3866:4321:5007:6114:6261:6642:6653:7576:9413:10004:11026:11473:11658:11914:12043:12296:12297:12517:12519:12555:12679:12895:13069:13311:13357:14096:14181:14384:14394:14721:21080:21444:21451:21627:21666:21990:30012:30054,0,RBL:209.85.215.196:@gmail.com:.lbl8.mailshell.net-62.50.0.100 66.100.201.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:24,LUA_SUMMARY:none X-HE-Tag: glove18_14956f076ea32 X-Filterd-Recvd-Size: 3284 Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by imf10.hostedemail.com (Postfix) with ESMTP for ; Mon, 16 Mar 2020 07:52:21 +0000 (UTC) Received: by mail-pg1-f196.google.com with SMTP id 37so9261102pgm.11 for ; Mon, 16 Mar 2020 00:52:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=VdKfflYM1ixI7HgwxJj0O2es8oHwECfmOKcNXeBwpQs=; b=Q9hiVXE4YZSBjfGxKkaZpwBuwPfZiMlR2vdihTShRnXnjyC0rZQQ4y0Y4Wl182SJBb JFWLSrcnbQ4k0tzIaouey/M8JDMq2y8wh+idjq1CDgrnAG/Yr88/Lk2lk0JrDjQjwBJr LrTJehHK5Zu2JObGcLzlIpvT7Ilyg4EjkNPxBt9/GeB7rUNhLl83OuR65Bh3HVoSFjEH pXLMDHfCV87mKWmjxINvG4x82XiFpItm+k40kh9jHEgmMZgnY1W2yR7NYANGk6WcF0mi 8G4CR8+c4Tld+9NwNMzqJRq1dGIzEqeo4zVELSCX4c1ej8NTDDmUmq9LwpJcH3dSLLuv P37g== 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=VdKfflYM1ixI7HgwxJj0O2es8oHwECfmOKcNXeBwpQs=; b=bJnfnn+0EHPCUNgJX5ouicglHFP9DES8jVOBcmHDKFt6PIrqU6vsgfN/KCRJUqrfFS NPp1tLQuhtA47LKhEKK60GRs2hwqGm3eHlE6ayI9bAhsjBgwDWhMj1pNadMs1WoBBmCD tXWQwrUiGRl/BtO+JfGRscQlve3RQZ4rBUcYxKbpQHXI2leF3rvi6kjEiTAkYk3Fc9Dp 89v9gNBqXC3ZsmbSHZq4ztYKCl+9CxoQdSFkrXGW4GJzC50M4y0zPtw/2eJAkcgFV9UC Tct8iLY1hC/J16JLBiioPHxDKPz3qKuPymggakfdTq/f/19Rj5GyJxt31dt6I37DXIJ/ Beww== X-Gm-Message-State: ANhLgQ1gXI9Zzu+DamxJvN3SOKgFV3FbciMJtFRFFh4hUDLCnop49mXq kSsT9/hTlPAv3xa+eOKrSvQ= X-Google-Smtp-Source: ADFU+vu9hJ6TtexA3Jlcg3tT2RN9xQsQYhJzEurmhepga9SUw4GwdWSpEza2LDyr1nqoDMemrpQLOA== X-Received: by 2002:a63:7e1c:: with SMTP id z28mr26351881pgc.105.1584345140084; Mon, 16 Mar 2020 00:52:20 -0700 (PDT) Received: from localhost ([43.224.245.179]) by smtp.gmail.com with ESMTPSA id z1sm14070214pfa.16.2020.03.16.00.52.19 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 16 Mar 2020 00:52:19 -0700 (PDT) From: qiwuchen55@gmail.com To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, chenqiwu Subject: [PATCH] mm/memory_hotplug: use __pfn_to_section() instead of open-coding Date: Mon, 16 Mar 2020 15:52:14 +0800 Message-Id: <1584345134-16671-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 __pfn_to_section() API instead of open-coding or better code readability. Signed-off-by: chenqiwu Acked-by: David Hildenbrand --- mm/memory_hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 19389cd..62e9c66 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -494,7 +494,7 @@ static void __remove_section(unsigned long pfn, unsigned long nr_pages, unsigned long map_offset, struct vmem_altmap *altmap) { - struct mem_section *ms = __nr_to_section(pfn_to_section_nr(pfn)); + struct mem_section *ms = __pfn_to_section(pfn); if (WARN_ON_ONCE(!valid_section(ms))) return;