* [PATCH v2] mm: move phys_mem_access_prot_allowed() declaration to pgtable.h
@ 2016-09-13 7:26 Baoyou Xie
2016-09-13 12:50 ` Thomas Gleixner
2016-09-16 13:55 ` Ralf Baechle
0 siblings, 2 replies; 3+ messages in thread
From: Baoyou Xie @ 2016-09-13 7:26 UTC (permalink / raw)
To: ralf, tglx, mingo, hpa, x86, arnd, akpm, paul.burton, chenhc,
david.daney, kumba, yamada.masahiro, kirill.shutemov,
dave.hansen, toshi.kani, dan.j.williams, luto, JBeulich
Cc: linux-mips, linux-kernel, linux-arch, baoyou.xie, xie.baoyou
We get 1 warning when building kernel with W=1:
drivers/char/mem.c:220:12: warning: no previous prototype for 'phys_mem_access_prot_allowed' [-Wmissing-prototypes]
int __weak phys_mem_access_prot_allowed(struct file *file,
In fact, its declaration is spreading to several header files
in different architecture, but need to be declare in common
header file.
So this patch moves phys_mem_access_prot_allowed() to pgtable.h.
Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
---
arch/mips/include/asm/pgtable.h | 2 --
arch/x86/include/asm/pgtable_types.h | 2 --
include/asm-generic/pgtable.h | 3 +++
3 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h
index 70128d3..9e9e944 100644
--- a/arch/mips/include/asm/pgtable.h
+++ b/arch/mips/include/asm/pgtable.h
@@ -673,8 +673,6 @@ static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm,
struct file;
pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
unsigned long size, pgprot_t vma_prot);
-int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn,
- unsigned long size, pgprot_t *vma_prot);
#endif
/*
diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h
index f1218f5..8b4de22 100644
--- a/arch/x86/include/asm/pgtable_types.h
+++ b/arch/x86/include/asm/pgtable_types.h
@@ -439,8 +439,6 @@ extern pgprot_t pgprot_writethrough(pgprot_t prot);
struct file;
pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
unsigned long size, pgprot_t vma_prot);
-int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn,
- unsigned long size, pgprot_t *vma_prot);
/* Install a pte for a particular vaddr in kernel space. */
void set_pte_vaddr(unsigned long vaddr, pte_t pte);
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index d4458b6..c4f8fd2 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -800,6 +800,9 @@ static inline int pmd_clear_huge(pmd_t *pmd)
#endif
#endif
+struct file;
+int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn,
+ unsigned long size, pgprot_t *vma_prot);
#endif /* !__ASSEMBLY__ */
#ifndef io_remap_pfn_range
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] mm: move phys_mem_access_prot_allowed() declaration to pgtable.h
2016-09-13 7:26 [PATCH v2] mm: move phys_mem_access_prot_allowed() declaration to pgtable.h Baoyou Xie
@ 2016-09-13 12:50 ` Thomas Gleixner
2016-09-16 13:55 ` Ralf Baechle
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Gleixner @ 2016-09-13 12:50 UTC (permalink / raw)
To: Baoyou Xie
Cc: ralf, mingo, hpa, x86, arnd, akpm, paul.burton, chenhc,
david.daney, kumba, yamada.masahiro, kirill.shutemov,
dave.hansen, toshi.kani, dan.j.williams, luto, JBeulich,
linux-mips, linux-kernel, linux-arch, xie.baoyou
On Tue, 13 Sep 2016, Baoyou Xie wrote:
> We get 1 warning when building kernel with W=1:
> drivers/char/mem.c:220:12: warning: no previous prototype for 'phys_mem_access_prot_allowed' [-Wmissing-prototypes]
> int __weak phys_mem_access_prot_allowed(struct file *file,
>
> In fact, its declaration is spreading to several header files
> in different architecture, but need to be declare in common
> header file.
>
> So this patch moves phys_mem_access_prot_allowed() to pgtable.h.
>
> Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
> ---
> arch/mips/include/asm/pgtable.h | 2 --
> arch/x86/include/asm/pgtable_types.h | 2 --
> include/asm-generic/pgtable.h | 3 +++
> 3 files changed, 3 insertions(+), 4 deletions(-)
Acked-by: Thomas Gleixner <tglx@linutronix.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] mm: move phys_mem_access_prot_allowed() declaration to pgtable.h
2016-09-13 7:26 [PATCH v2] mm: move phys_mem_access_prot_allowed() declaration to pgtable.h Baoyou Xie
2016-09-13 12:50 ` Thomas Gleixner
@ 2016-09-16 13:55 ` Ralf Baechle
1 sibling, 0 replies; 3+ messages in thread
From: Ralf Baechle @ 2016-09-16 13:55 UTC (permalink / raw)
To: Baoyou Xie
Cc: tglx, mingo, hpa, x86, arnd, akpm, paul.burton, chenhc,
david.daney, kumba, yamada.masahiro, kirill.shutemov,
dave.hansen, toshi.kani, dan.j.williams, luto, JBeulich,
linux-mips, linux-kernel, linux-arch, xie.baoyou
On Tue, Sep 13, 2016 at 03:26:37PM +0800, Baoyou Xie wrote:
> We get 1 warning when building kernel with W=1:
> drivers/char/mem.c:220:12: warning: no previous prototype for 'phys_mem_access_prot_allowed' [-Wmissing-prototypes]
> int __weak phys_mem_access_prot_allowed(struct file *file,
>
> In fact, its declaration is spreading to several header files
> in different architecture, but need to be declare in common
> header file.
>
> So this patch moves phys_mem_access_prot_allowed() to pgtable.h.
>
> Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Ralf
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-09-16 13:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-13 7:26 [PATCH v2] mm: move phys_mem_access_prot_allowed() declaration to pgtable.h Baoyou Xie
2016-09-13 12:50 ` Thomas Gleixner
2016-09-16 13:55 ` Ralf Baechle
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.