Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm: move phys_mem_access_prot_allowed() declaration to pgtable.h

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.

Link: http://lkml.kernel.org/r/1473751597-12139-1-git-send-email-baoyou.xie@linaro.org
Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Baoyou Xie and committed by
Linus Torvalds
08ea8c07 cc30c5d6

+3 -4
-2
arch/mips/include/asm/pgtable.h
··· 673 673 struct file; 674 674 pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, 675 675 unsigned long size, pgprot_t vma_prot); 676 - int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn, 677 - unsigned long size, pgprot_t *vma_prot); 678 676 #endif 679 677 680 678 /*
-2
arch/x86/include/asm/pgtable_types.h
··· 439 439 struct file; 440 440 pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, 441 441 unsigned long size, pgprot_t vma_prot); 442 - int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn, 443 - unsigned long size, pgprot_t *vma_prot); 444 442 445 443 /* Install a pte for a particular vaddr in kernel space. */ 446 444 void set_pte_vaddr(unsigned long vaddr, pte_t pte);
+3
include/asm-generic/pgtable.h
··· 800 800 #endif 801 801 #endif 802 802 803 + struct file; 804 + int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn, 805 + unsigned long size, pgprot_t *vma_prot); 803 806 #endif /* !__ASSEMBLY__ */ 804 807 805 808 #ifndef io_remap_pfn_range