From patchwork Fri Nov 5 20:38:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12605501 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 439D8C433EF for ; Fri, 5 Nov 2021 20:38:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0D09160174 for ; Fri, 5 Nov 2021 20:38:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0D09160174 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 9415D940041; Fri, 5 Nov 2021 16:38:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8F13594003D; Fri, 5 Nov 2021 16:38:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7E0B7940041; Fri, 5 Nov 2021 16:38:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0249.hostedemail.com [216.40.44.249]) by kanga.kvack.org (Postfix) with ESMTP id 6089194003D for ; Fri, 5 Nov 2021 16:38:17 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 1DF961801E236 for ; Fri, 5 Nov 2021 20:38:17 +0000 (UTC) X-FDA: 78776039034.07.9FA14A8 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf22.hostedemail.com (Postfix) with ESMTP id BC781190C for ; Fri, 5 Nov 2021 20:38:16 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id CC7446056B; Fri, 5 Nov 2021 20:38:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1636144696; bh=7aqVEQ2BNP1wlsrk4fse+g/i3lItD/S7wyUeyrYH/SY=; h=Date:From:To:Subject:In-Reply-To:From; b=KiO5BLES9XX+fQuWzlTDf16CBIte6Ybo1cu+8Vul0l4Q+OQERWsWMZLEBZvpiVlvl pwQL1iSjFQsvdMpCuNHlDg42RmWwNZE0DwzwQLtZpA4KRbS3nlTXt4o+16ZSkf5+iw EFq4sJ865rmo5k5TPiDF7szyZGpbPp34DYTR2GLk= Date: Fri, 05 Nov 2021 13:38:15 -0700 From: Andrew Morton To: akpm@linux-foundation.org, eb@emlix.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, torvalds@linux-foundation.org Subject: [patch 069/262] mm: use __pfn_to_section() instead of open coding it Message-ID: <20211105203815.dJG5uSPY1%akpm@linux-foundation.org> In-Reply-To: <20211105133408.cccbb98b71a77d5e8430aba1@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: BC781190C X-Stat-Signature: k3bnky7ys94cyfrgpaj3r118u16bse6b Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=KiO5BLES; spf=pass (imf22.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-HE-Tag: 1636144696-446767 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Rolf Eike Beer Subject: mm: use __pfn_to_section() instead of open coding it It is defined in the same file just a few lines above. Link: https://lkml.kernel.org/r/4598487.Rc0NezkW7i@mobilepool36.emlix.com Signed-off-by: Rolf Eike Beer Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton --- include/linux/mmzone.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/include/linux/mmzone.h~mm-use-__pfn_to_section-instead-of-open-coding-it +++ a/include/linux/mmzone.h @@ -1481,7 +1481,7 @@ static inline int pfn_valid(unsigned lon if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS) return 0; - ms = __nr_to_section(pfn_to_section_nr(pfn)); + ms = __pfn_to_section(pfn); if (!valid_section(ms)) return 0; /* @@ -1496,7 +1496,7 @@ static inline int pfn_in_present_section { if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS) return 0; - return present_section(__nr_to_section(pfn_to_section_nr(pfn))); + return present_section(__pfn_to_section(pfn)); } static inline unsigned long next_present_section_nr(unsigned long section_nr)