Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3518468pxb; Mon, 24 Jan 2022 11:14:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJzynx06hxVv5OcwtvGJaeyqlAY5zT2yglHlKTiFKRdaeh6cpuliqClgeTSU/0C8tGh3Uwp6 X-Received: by 2002:a63:da4e:: with SMTP id l14mr13005601pgj.220.1643051673119; Mon, 24 Jan 2022 11:14:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643051673; cv=none; d=google.com; s=arc-20160816; b=eAglVs3OgvmDkKIjPHKqJVGImZRbw6tphz78QHEq9m/9cFgK8IA300njv85Y/q7mOk wYyD0x5SX67Oe7++U1P3WysC9rvIuNVR9Se2oo7j7LFHc8WNG1Skmxkv/wV9Z4uTu6mE BryaL+9qGgPv2Fb9wgEsEThIykRJt72wJxC8Upe9oRr2UPXVzjs4wJXObuU1+MaAuvCI sd7oqD2au5h9LyReXtZEllZjrY412qzdQrSn1l1AlblGVW5T+ITiBN5vKrDznt564RTK JlFsUzyHTPHj57xUYSkHeICWQoAjXduu8XAzgIUNmzdtSWELDCOJnnak0C3Qs9DeKxEL Ys3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=V9WRbBWrmKYnSMT4v7xT+F4Ahsl7J1O53z1dVQcB5DM=; b=SpwjSQTpnDABzZr3kwE9yif0o1PDNYpTYWAr5Z82vBxDZSYcDmyXFtbgVYmMuPRY5e IVXuhFilYSwNAM85I4p87m9WIh0u2qee8MYgeVj5dB5ku4EvAaGIqM6W+1dUAGe9K/r0 cj0wz/0FbLe4YIxBPW4O+T5HwpC8jL+WrELMucuEJyeZjWP8ysjoXOkDhDmbnfMnjZsH RGQV2kptiq4CchOava3tJDth7M4NoOb9vqCJR3ZnTyi+OkF2Brvi5B1om7CkmZllfU24 6B6jejWIGUflt3J4ZmFM/e8C19N8tD3GC8JZVR79f1XmdmyYRdxWfT+YNBoaa31jhP3Y F4Gw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z3si11587049pla.559.2022.01.24.11.14.20; Mon, 24 Jan 2022 11:14:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242789AbiAXM6I (ORCPT + 99 others); Mon, 24 Jan 2022 07:58:08 -0500 Received: from foss.arm.com ([217.140.110.172]:33018 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242795AbiAXM6B (ORCPT ); Mon, 24 Jan 2022 07:58:01 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E1D2B101E; Mon, 24 Jan 2022 04:58:00 -0800 (PST) Received: from p8cg001049571a15.arm.com (unknown [10.163.43.190]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 4F8F93F774; Mon, 24 Jan 2022 04:57:57 -0800 (PST) From: Anshuman Khandual To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, hch@infradead.org, akpm@linux-foundation.org, Anshuman Khandual Subject: [RFC V1 13/31] mm/mmap: Drop arch_vm_get_page_pgprot() Date: Mon, 24 Jan 2022 18:26:50 +0530 Message-Id: <1643029028-12710-14-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1643029028-12710-1-git-send-email-anshuman.khandual@arm.com> References: <1643029028-12710-1-git-send-email-anshuman.khandual@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There are no platforms left which use arch_vm_get_page_prot(). Just drop arch_vm_get_page_prot() construct and simplify remaining code. Cc: Andrew Morton Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- include/linux/mman.h | 4 ---- mm/mmap.c | 10 +--------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/include/linux/mman.h b/include/linux/mman.h index b66e91b8176c..58b3abd457a3 100644 --- a/include/linux/mman.h +++ b/include/linux/mman.h @@ -93,10 +93,6 @@ static inline void vm_unacct_memory(long pages) #define arch_calc_vm_flag_bits(flags) 0 #endif -#ifndef arch_vm_get_page_prot -#define arch_vm_get_page_prot(vm_flags) __pgprot(0) -#endif - #ifndef arch_validate_prot /* * This is called from mprotect(). PROT_GROWSDOWN and PROT_GROWSUP have diff --git a/mm/mmap.c b/mm/mmap.c index 70a75ea91e94..2fc597cf8b8d 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -102,7 +102,7 @@ static void unmap_region(struct mm_struct *mm, * w: (no) no * x: (yes) yes */ -static inline pgprot_t __vm_get_page_prot(unsigned long vm_flags) +pgprot_t vm_get_page_prot(unsigned long vm_flags) { switch (vm_flags & (VM_READ | VM_WRITE | VM_EXEC | VM_SHARED)) { case VM_NONE: @@ -141,14 +141,6 @@ static inline pgprot_t __vm_get_page_prot(unsigned long vm_flags) BUILD_BUG(); } } - -pgprot_t vm_get_page_prot(unsigned long vm_flags) -{ - pgprot_t ret = __pgprot(pgprot_val(__vm_get_page_prot(vm_flags)) | - pgprot_val(arch_vm_get_page_prot(vm_flags))); - - return ret; -} EXPORT_SYMBOL(vm_get_page_prot); #endif /* CONFIG_ARCH_HAS_VM_GET_PAGE_PROT */ -- 2.25.1