Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3519497pxb; Mon, 24 Jan 2022 11:15:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJxuSWvV5nLSB0zNJcvNVGHKES1e3zVpLnkLF+iwNgM2qMvDlg9wh7W9mXC/rIpOxEIAECJw X-Received: by 2002:a17:90a:77c6:: with SMTP id e6mr3346395pjs.115.1643051756544; Mon, 24 Jan 2022 11:15:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643051756; cv=none; d=google.com; s=arc-20160816; b=KTOrVVzVh67Gzr55ZO7Q3Q1QaUsUdTdFqCvBREWhwpF18zWHioh/6TMX0Zdtg3KSqE GuJsANM8gKru5NAtY9mhfFgLFtAYt81rQnvDdnToNrdNZmutCkktyizsIsUrtzF23KgX +V/3dyTuqLNu4wLyEkFcLdBv4a6O6k4pmYCLN83dWxAPb8rwPdEvNMRLIf89I2szyQ74 veJj1wENWeL6+lzutW88ThLtusB86xTLJUnKN1ooJzTMOr0d2czpfFpAEWGxG+R6cEnK gotEBzzJ4H//tXY0Dk2bEpKwx+BYUHr+LuwbH+zuRKUpVo2oh28RTY8KKj8BWUmG2zMk Nbqg== 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=psinpGSwT1vgenEHYDtBSw/ksRiZQ3tVc+cCA+d/d8g=; b=BJiZK/2CRGRphdUDNqamVs3iJc2Qaz5/UgFfW4jNIjDUuheJIr2Mi02chnxSIXgo35 Unlb/2GUxUOd0zBbxIx2vniZ4Pb5ywim6IfWLs/Xbr4PnOURH6HKzgaxttN9w1re62Kn i040ry1GHmeP9CrFL1s9OEsOAeIoud+Lb2UAwzr1fUzOTmhFQ90+Zj5IfsSkMUgQKR0s Mtj9/R+rjeblbiHvp3w7xZCapCxCGfUyYdPTw4aD7++xd+VgWnkA4gsnhoQQqMbjNFj4 aKUdH/wzyAczexu2M48UoEaJ8V14oGEVeN2mKsgcHlMjF6icZZGide3Z3GNNQfAEyAeI yl9A== 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 o4si12142405pls.567.2022.01.24.11.15.42; Mon, 24 Jan 2022 11:15:56 -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 S242964AbiAXM7b (ORCPT + 99 others); Mon, 24 Jan 2022 07:59:31 -0500 Received: from foss.arm.com ([217.140.110.172]:33280 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242869AbiAXM7G (ORCPT ); Mon, 24 Jan 2022 07:59:06 -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 E4B0111D4; Mon, 24 Jan 2022 04:59:05 -0800 (PST) Received: from p8cg001049571a15.arm.com (unknown [10.163.43.190]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 6F3733F774; Mon, 24 Jan 2022 04:59:03 -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 29/31] mm/mmap: Drop generic vm_get_page_prot() Date: Mon, 24 Jan 2022 18:27:06 +0530 Message-Id: <1643029028-12710-30-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 All available platforms export their own vm_get_page_prot() implementation via ARCH_HAS_VM_GET_PAGE_PROT. Hence a generic implementation is no longer needed. Cc: Andrew Morton Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- mm/mmap.c | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index 2fc597cf8b8d..368bc8aee45b 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -102,46 +102,6 @@ static void unmap_region(struct mm_struct *mm, * w: (no) no * x: (yes) yes */ -pgprot_t vm_get_page_prot(unsigned long vm_flags) -{ - switch (vm_flags & (VM_READ | VM_WRITE | VM_EXEC | VM_SHARED)) { - case VM_NONE: - return __P000; - case VM_READ: - return __P001; - case VM_WRITE: - return __P010; - case VM_READ | VM_WRITE: - return __P011; - case VM_EXEC: - return __P100; - case VM_EXEC | VM_READ: - return __P101; - case VM_EXEC | VM_WRITE: - return __P110; - case VM_EXEC | VM_READ | VM_WRITE: - return __P111; - case VM_SHARED: - return __S000; - case VM_SHARED | VM_READ: - return __S001; - case VM_SHARED | VM_WRITE: - return __S010; - case VM_SHARED | VM_READ | VM_WRITE: - return __S011; - case VM_SHARED | VM_EXEC: - return __S100; - case VM_SHARED | VM_EXEC | VM_READ: - return __S101; - case VM_SHARED | VM_EXEC | VM_WRITE: - return __S110; - case VM_SHARED | VM_EXEC | VM_READ | VM_WRITE: - return __S111; - default: - BUILD_BUG(); - } -} -EXPORT_SYMBOL(vm_get_page_prot); #endif /* CONFIG_ARCH_HAS_VM_GET_PAGE_PROT */ static pgprot_t vm_pgprot_modify(pgprot_t oldprot, unsigned long vm_flags) -- 2.25.1