Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp3613200pxb; Mon, 21 Feb 2022 01:50:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJxsNnmMv0xxF1hcS/PWl3oRh6qWyOqyF8XC8v1T9XGGFqVP354pZd5Vtp35BfncQv8VGC+G X-Received: by 2002:a17:90a:aa91:b0:1b5:6032:5459 with SMTP id l17-20020a17090aaa9100b001b560325459mr24887865pjq.116.1645437023105; Mon, 21 Feb 2022 01:50:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645437023; cv=none; d=google.com; s=arc-20160816; b=YldXjESYqfd6fNfKwIPYKG7hEA7GhvySKXZSk8XaMCr5oxEFhFnvpjvYtlxsarTh60 1N2gXOf0xWyaaBsRJU1Ei4AkzwCYFmTGz7vrvNhL9d+Cpu/AIbGhegjDyXl8MC9UtSHy 9t4hOLMYEcmFFw6RfMSIFQyL6kKopS3B9QIPlySYiLsAXmbj+MTfiPpN++2TcdL5xjlX 3J+ukMCveRnzsrMXDQnQFulQTJ9VJZCvkDtEXQ8axaG2iOEqltdNczo1hDr2tAtblFcg aF7D3A01o1Bbqd4LWLAj7rWe/s4CVqpk3f/f1SeymUsRXQ/vIytIicIiPrdEcYHKeBqk M1JQ== 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=v6K0juW0/+Vt5MU5M38xhW0DWBjzhSYYSX7iDLWxJurA8ft06RZfi5uc0lSlC248Lr jQHjczF8P/WcEZhbfzj6DcdlBMD0ux8mW67Kg96vunSRkMroYKE/Jg9OCKzf44Z3uJc1 ONIyyS3wA77EaDiEwQmX0xWWlW/LbPTvYh1VZ/4E/THxkvgCtWAlB+HjPDY/6OEv16+7 O6ObheiShpDdkuwF6BGCTDdl233epG1iAo9hwDTAZ8sfmEFs88RHevKk/uMhoB/QJAVF cqXl3o8m99XNR8hT0YJLiwb/lnp9nxZ7chI9TFHuZTPvNQDnDGDOPzQECXpICXFOsf/E Elqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y10si2861612pgu.635.2022.02.21.01.50.09; Mon, 21 Feb 2022 01:50:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1345591AbiBUGmW (ORCPT + 99 others); Mon, 21 Feb 2022 01:42:22 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:42294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345402AbiBUGl2 (ORCPT ); Mon, 21 Feb 2022 01:41:28 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0B236275DE; Sun, 20 Feb 2022 22:40:24 -0800 (PST) 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 CE150150C; Sun, 20 Feb 2022 22:40:23 -0800 (PST) Received: from p8cg001049571a15.arm.com (unknown [10.163.49.67]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 8CE873F70D; Sun, 20 Feb 2022 22:40:21 -0800 (PST) From: Anshuman Khandual To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, Anshuman Khandual , Christoph Hellwig , linux-arch@vger.kernel.org Subject: [PATCH V2 29/30] mm/mmap: Drop generic vm_get_page_prot() Date: Mon, 21 Feb 2022 12:08:38 +0530 Message-Id: <1645425519-9034-30-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1645425519-9034-1-git-send-email-anshuman.khandual@arm.com> References: <1645425519-9034-1-git-send-email-anshuman.khandual@arm.com> X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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