Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752950Ab2KPQ2e (ORCPT ); Fri, 16 Nov 2012 11:28:34 -0500 Received: from mail-ee0-f46.google.com ([74.125.83.46]:58067 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752832Ab2KPQZ4 (ORCPT ); Fri, 16 Nov 2012 11:25:56 -0500 From: Ingo Molnar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Paul Turner , Lee Schermerhorn , Christoph Lameter , Rik van Riel , Mel Gorman , Andrew Morton , Andrea Arcangeli , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , Hugh Dickins Subject: [PATCH 10/19] mm/pgprot: Move the pgprot_modify() fallback definition to mm.h Date: Fri, 16 Nov 2012 17:25:12 +0100 Message-Id: <1353083121-4560-11-git-send-email-mingo@kernel.org> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1353083121-4560-1-git-send-email-mingo@kernel.org> References: <1353083121-4560-1-git-send-email-mingo@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2259 Lines: 69 pgprot_modify() is available on x86, but on other architectures it only gets defined in mm/mprotect.c - breaking the build if anything outside of mprotect.c tries to make use of this function. Move it to the generic pgprot area in mm.h, so that an upcoming patch can make use of it. Acked-by: Peter Zijlstra Cc: Rik van Riel Cc: Paul Turner Cc: Linus Torvalds Cc: Andrew Morton Link: http://lkml.kernel.org/n/tip-nfvarGMj9gjavowroorkizb4@git.kernel.org Signed-off-by: Ingo Molnar --- include/linux/mm.h | 13 +++++++++++++ mm/mprotect.c | 7 ------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index fa06804..2a32cf8 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -164,6 +164,19 @@ extern pgprot_t protection_map[16]; #define FAULT_FLAG_TRIED 0x40 /* second try */ /* + * Some architectures (such as x86) may need to preserve certain pgprot + * bits, without complicating generic pgprot code. + * + * Most architectures don't care: + */ +#ifndef pgprot_modify +static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot) +{ + return newprot; +} +#endif + +/* * vm_fault is filled by the the pagefault handler and passed to the vma's * ->fault function. The vma's ->fault is responsible for returning a bitmask * of VM_FAULT_xxx flags that give details about how the fault was handled. diff --git a/mm/mprotect.c b/mm/mprotect.c index a409926..e97b0d6 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c @@ -28,13 +28,6 @@ #include #include -#ifndef pgprot_modify -static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot) -{ - return newprot; -} -#endif - static void change_pte_range(struct mm_struct *mm, pmd_t *pmd, unsigned long addr, unsigned long end, pgprot_t newprot, int dirty_accountable) -- 1.7.11.7 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/