From patchwork Thu May 31 13:54:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirill A . Shutemov" X-Patchwork-Id: 10441147 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E60A5602BF for ; Thu, 31 May 2018 13:55:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D678F29097 for ; Thu, 31 May 2018 13:55:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB11B291D8; Thu, 31 May 2018 13:55:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 579E329097 for ; Thu, 31 May 2018 13:55:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E3E2A6B0006; Thu, 31 May 2018 09:55:05 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id DC09A6B0008; Thu, 31 May 2018 09:55:05 -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 CAF566B000C; Thu, 31 May 2018 09:55:05 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf0-f200.google.com (mail-pf0-f200.google.com [209.85.192.200]) by kanga.kvack.org (Postfix) with ESMTP id 8A3836B0006 for ; Thu, 31 May 2018 09:55:05 -0400 (EDT) Received: by mail-pf0-f200.google.com with SMTP id w7-v6so12807089pfd.9 for ; Thu, 31 May 2018 06:55:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=eS6vmZk2PVQOdqSs/gKLSOiqrNMF8NH0KfxvIEjX0zU=; b=kw/8xUN5rKl7zqZlEviUQ4lb2ynaOu2J9HiXY4HABYQWnaTNBmLxaAWQ3QeE/XQW/s hFvRZzmCom/N7YwnYEDuNiYMUgQ6Rjscv5ARqEmQFd5/o60UYs7d3/vWprf1nME5yM9S +/8VyEpBtHxe2btbGtBNeXPor/VlZ1wOkYx0UZYCBFoQTEPjprwQaYNOaYE8sWCi1XiU rjDlkojTDuK1rIIo9Tmw639HLzM7I7YDdocd/VMQhzhjkUShX868kqJtUzRPO1cRXphp uLPdgokZx4WDwTDtpB+oJbLQMdddI6oMtkttrkywoO5O6Fwgm0kM/2dcicLDXslhXRyA MgEg== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of kirill.shutemov@linux.intel.com designates 192.55.52.115 as permitted sender) smtp.mailfrom=kirill.shutemov@linux.intel.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Gm-Message-State: ALKqPwcqrJbXiV7M3P8so6nzWXNA0RdqtHSUEySx/lzi3/h3IjN7zv+P FMKuSuWCKZnSH9yp0yRauMeamSEhBjku37PIV4+co3cww4za6WGf9H2xhJ7iAHdZAOuw/3lnNbd /ErKz7Ibrs4McilJn1UFyfQk14DNQfk3wCHw/D1BgDWknfjrnNPWJOw5W/defhDDgJg== X-Received: by 2002:a63:a513:: with SMTP id n19-v6mr5537684pgf.381.1527774905267; Thu, 31 May 2018 06:55:05 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKvnInk4vEt51LtvQx8L8eVnVuNcoh9F4agEskoJBa/K+dtqDU1o6r+8BYZmujxGzLuQ7lo X-Received: by 2002:a63:a513:: with SMTP id n19-v6mr5537650pgf.381.1527774904504; Thu, 31 May 2018 06:55:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527774904; cv=none; d=google.com; s=arc-20160816; b=HR5xIb0nqQwl+Vkuoj1g4B5uM8EnqE9x9fFRkhB5T6xAaebRJOKD1qXCPzg+MizqcM s8J+zaYaqZ9Pn9j+frroKgWU4DqYZREcqWgVP7CsfK+3LjnbyUoiRFOAF5YsHUixp0oQ dc6w76jtbIRWCWzl77UK49Fvj/DcMK58SrabVqIHdzCVAzMgAh0WtPOyZRMig+hdtugs k84ByE6uiUfEOWRDk6saJ62VJLb28QgMRxgDCi1+MExAC86E1UwDVtNv8Zc4ZRrSHrw5 DwD5OclN4gk5dfiw0nmNNpBMVtgPhZv6C7qooaCrzcB9qHuF+pDLe+7nFSu4/UU9n20e OoHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=eS6vmZk2PVQOdqSs/gKLSOiqrNMF8NH0KfxvIEjX0zU=; b=G0zQrZoJVvL3PLfQvoVElOOaVAx6zOkdCC35nCQtmItrkdHiyXSWhsl6aC89JqI9aS paSTUxmqIn5VtPpMeWsiF5VgfjyKA1MwEwq7FzdtqiVuebjUHgOhsZT2xvPMIVy8xnsS G8q0io4Cau84n2zpvX758Lx/dtAjgQ1GFEUuNSJ2EdI67Wd5NBr0CkH6JfrzbNcQj+56 4liVA/YCAY/ax4qdML/rsQeFj/cAkamzUtnZ6YA8bnBcTtyO9Hb2CrOolaGOb/KQXKSQ C3AmjhhzPNEk4Kk0DK8MWeMATGWR5mQU+zNiRniWUjB8ECJk2kT4PlNrs58LDtsPVwYD C/zQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of kirill.shutemov@linux.intel.com designates 192.55.52.115 as permitted sender) smtp.mailfrom=kirill.shutemov@linux.intel.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from mga14.intel.com (mga14.intel.com. [192.55.52.115]) by mx.google.com with ESMTPS id b66-v6si37586672plb.107.2018.05.31.06.55.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 May 2018 06:55:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of kirill.shutemov@linux.intel.com designates 192.55.52.115 as permitted sender) client-ip=192.55.52.115; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of kirill.shutemov@linux.intel.com designates 192.55.52.115 as permitted sender) smtp.mailfrom=kirill.shutemov@linux.intel.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 May 2018 06:55:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,463,1520924400"; d="scan'208";a="59243464" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga004.fm.intel.com with ESMTP; 31 May 2018 06:55:02 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id C74B6FD; Thu, 31 May 2018 16:55:01 +0300 (EEST) From: "Kirill A. Shutemov" To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kirill A. Shutemov" Subject: [PATCH 2/2] mm/page_ext: Constify lookup_page_ext() argument Date: Thu, 31 May 2018 16:54:57 +0300 Message-Id: <20180531135457.20167-3-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180531135457.20167-1-kirill.shutemov@linux.intel.com> References: <20180531135457.20167-1-kirill.shutemov@linux.intel.com> 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: X-Virus-Scanned: ClamAV using ClamSMTP lookup_page_ext() finds 'struct page_ext' for a given page. It requires only read access to the given struct page. Current implemnentation takes 'struct page *' as an argument. It makes compiler complain when 'const struct page *' passed. Change the argument to 'const struct page *'. Signed-off-by: Kirill A. Shutemov --- include/linux/page_ext.h | 4 ++-- mm/page_ext.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/page_ext.h b/include/linux/page_ext.h index bbec618a614b..f84f167ec04c 100644 --- a/include/linux/page_ext.h +++ b/include/linux/page_ext.h @@ -50,7 +50,7 @@ static inline void page_ext_init(void) } #endif -struct page_ext *lookup_page_ext(struct page *page); +struct page_ext *lookup_page_ext(const struct page *page); #else /* !CONFIG_PAGE_EXTENSION */ struct page_ext; @@ -59,7 +59,7 @@ static inline void pgdat_page_ext_init(struct pglist_data *pgdat) { } -static inline struct page_ext *lookup_page_ext(struct page *page) +static inline struct page_ext *lookup_page_ext(const struct page *page) { return NULL; } diff --git a/mm/page_ext.c b/mm/page_ext.c index 5295ef331165..a9826da84ccb 100644 --- a/mm/page_ext.c +++ b/mm/page_ext.c @@ -120,7 +120,7 @@ void __meminit pgdat_page_ext_init(struct pglist_data *pgdat) pgdat->node_page_ext = NULL; } -struct page_ext *lookup_page_ext(struct page *page) +struct page_ext *lookup_page_ext(const struct page *page) { unsigned long pfn = page_to_pfn(page); unsigned long index; @@ -195,7 +195,7 @@ void __init page_ext_init_flatmem(void) #else /* CONFIG_FLAT_NODE_MEM_MAP */ -struct page_ext *lookup_page_ext(struct page *page) +struct page_ext *lookup_page_ext(const struct page *page) { unsigned long pfn = page_to_pfn(page); struct mem_section *section = __pfn_to_section(pfn);