diff options
author | Mike Rapoport <rppt@linux.ibm.com> | 2020-06-08 21:32:33 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-06-09 09:39:13 -0700 |
commit | e31cf2f4ca422ac9b14ecc4a1295b8977a20f812 (patch) | |
tree | 52533470ee6bb0a9a7d6d56e8aa885f3b6d14945 /drivers | |
parent | 9cb8f069deeed708bf19486d5893e297dc467ae0 (diff) | |
download | lwn-e31cf2f4ca422ac9b14ecc4a1295b8977a20f812.tar.gz lwn-e31cf2f4ca422ac9b14ecc4a1295b8977a20f812.zip |
mm: don't include asm/pgtable.h if linux/mm.h is already included
Patch series "mm: consolidate definitions of page table accessors", v2.
The low level page table accessors (pXY_index(), pXY_offset()) are
duplicated across all architectures and sometimes more than once. For
instance, we have 31 definition of pgd_offset() for 25 supported
architectures.
Most of these definitions are actually identical and typically it boils
down to, e.g.
static inline unsigned long pmd_index(unsigned long address)
{
return (address >> PMD_SHIFT) & (PTRS_PER_PMD - 1);
}
static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
{
return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(address);
}
These definitions can be shared among 90% of the arches provided
XYZ_SHIFT, PTRS_PER_XYZ and xyz_page_vaddr() are defined.
For architectures that really need a custom version there is always
possibility to override the generic version with the usual ifdefs magic.
These patches introduce include/linux/pgtable.h that replaces
include/asm-generic/pgtable.h and add the definitions of the page table
accessors to the new header.
This patch (of 12):
The linux/mm.h header includes <asm/pgtable.h> to allow inlining of the
functions involving page table manipulations, e.g. pte_alloc() and
pmd_alloc(). So, there is no point to explicitly include <asm/pgtable.h>
in the files that include <linux/mm.h>.
The include statements in such cases are remove with a simple loop:
for f in $(git grep -l "include <linux/mm.h>") ; do
sed -i -e '/include <asm\/pgtable.h>/ d' $f
done
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Cain <bcain@codeaurora.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Chris Zankel <chris@zankel.net>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Greentime Hu <green.hu@gmail.com>
Cc: Greg Ungerer <gerg@linux-m68k.org>
Cc: Guan Xuetao <gxt@pku.edu.cn>
Cc: Guo Ren <guoren@kernel.org>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Helge Deller <deller@gmx.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Ley Foon Tan <ley.foon.tan@intel.com>
Cc: Mark Salter <msalter@redhat.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Nick Hu <nickhu@andestech.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Rich Felker <dalias@libc.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Stafford Horne <shorne@gmail.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Vincent Chen <deanbo422@gmail.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Will Deacon <will@kernel.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Link: http://lkml.kernel.org/r/20200514170327.31389-1-rppt@kernel.org
Link: http://lkml.kernel.org/r/20200514170327.31389-2-rppt@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
35 files changed, 0 insertions, 35 deletions
diff --git a/drivers/char/agp/frontend.c b/drivers/char/agp/frontend.c index 47098648502d..00ff5fcb808a 100644 --- a/drivers/char/agp/frontend.c +++ b/drivers/char/agp/frontend.c @@ -39,7 +39,6 @@ #include <linux/fs.h> #include <linux/sched.h> #include <linux/uaccess.h> -#include <asm/pgtable.h> #include "agp.h" struct agp_front_data agp_fe; diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c index 9e84239f88d4..3ffbb1c80c5c 100644 --- a/drivers/char/agp/generic.c +++ b/drivers/char/agp/generic.c @@ -42,7 +42,6 @@ #ifdef CONFIG_X86 #include <asm/set_memory.h> #endif -#include <asm/pgtable.h> #include "agp.h" __u32 *agp_gatt_table; diff --git a/drivers/char/bsr.c b/drivers/char/bsr.c index e5e5333f302d..cce2af5df7b4 100644 --- a/drivers/char/bsr.c +++ b/drivers/char/bsr.c @@ -17,7 +17,6 @@ #include <linux/list.h> #include <linux/mm.h> #include <linux/slab.h> -#include <asm/pgtable.h> #include <asm/io.h> /* diff --git a/drivers/char/mspec.c b/drivers/char/mspec.c index 7d583222e8fa..d620e48bb8f7 100644 --- a/drivers/char/mspec.c +++ b/drivers/char/mspec.c @@ -39,7 +39,6 @@ #include <linux/numa.h> #include <linux/refcount.h> #include <asm/page.h> -#include <asm/pgtable.h> #include <linux/atomic.h> #include <asm/tlbflush.h> #include <asm/uncached.h> diff --git a/drivers/gpu/drm/i915/i915_mm.c b/drivers/gpu/drm/i915/i915_mm.c index b6376b25ef63..43039dc8c607 100644 --- a/drivers/gpu/drm/i915/i915_mm.c +++ b/drivers/gpu/drm/i915/i915_mm.c @@ -25,7 +25,6 @@ #include <linux/mm.h> #include <linux/io-mapping.h> -#include <asm/pgtable.h> #include "i915_drv.h" diff --git a/drivers/infiniband/sw/rdmavt/mmap.c b/drivers/infiniband/sw/rdmavt/mmap.c index 37853aa3bcf7..f5d0e33cf3d7 100644 --- a/drivers/infiniband/sw/rdmavt/mmap.c +++ b/drivers/infiniband/sw/rdmavt/mmap.c @@ -48,7 +48,6 @@ #include <linux/slab.h> #include <linux/vmalloc.h> #include <linux/mm.h> -#include <asm/pgtable.h> #include <rdma/uverbs_ioctl.h> #include "mmap.h" diff --git a/drivers/infiniband/sw/rxe/rxe_mmap.c b/drivers/infiniband/sw/rxe/rxe_mmap.c index 6a413d73b95d..7887f623f62c 100644 --- a/drivers/infiniband/sw/rxe/rxe_mmap.c +++ b/drivers/infiniband/sw/rxe/rxe_mmap.c @@ -35,7 +35,6 @@ #include <linux/vmalloc.h> #include <linux/mm.h> #include <linux/errno.h> -#include <asm/pgtable.h> #include <rdma/uverbs_ioctl.h> #include "rxe.h" diff --git a/drivers/media/platform/davinci/vpbe_display.c b/drivers/media/platform/davinci/vpbe_display.c index 38d3088d4d38..7ab13eb7527d 100644 --- a/drivers/media/platform/davinci/vpbe_display.c +++ b/drivers/media/platform/davinci/vpbe_display.c @@ -17,7 +17,6 @@ #include <linux/videodev2.h> #include <linux/slab.h> -#include <asm/pgtable.h> #include <media/v4l2-dev.h> #include <media/v4l2-common.h> diff --git a/drivers/media/v4l2-core/v4l2-common.c b/drivers/media/v4l2-core/v4l2-common.c index 9e8eb45a5b03..3dc17ebe14fa 100644 --- a/drivers/media/v4l2-core/v4l2-common.c +++ b/drivers/media/v4l2-core/v4l2-common.c @@ -41,7 +41,6 @@ #include <linux/string.h> #include <linux/errno.h> #include <linux/uaccess.h> -#include <asm/pgtable.h> #include <asm/io.h> #include <asm/div64.h> #include <media/v4l2-common.h> diff --git a/drivers/misc/sgi-gru/grufault.c b/drivers/misc/sgi-gru/grufault.c index 4b713a80b572..ddd7312e7c0c 100644 --- a/drivers/misc/sgi-gru/grufault.c +++ b/drivers/misc/sgi-gru/grufault.c @@ -21,7 +21,6 @@ #include <linux/uaccess.h> #include <linux/security.h> #include <linux/prefetch.h> -#include <asm/pgtable.h> #include "gru.h" #include "grutables.h" #include "grulib.h" diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index f0fe7bb2a750..54b53dbdb33c 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -52,7 +52,6 @@ #endif #include <linux/uaccess.h> -#include <asm/pgtable.h> #include <asm/irq.h> #ifdef CONFIG_PCI diff --git a/drivers/sbus/char/flash.c b/drivers/sbus/char/flash.c index 4147d22fd448..3adfef210d8e 100644 --- a/drivers/sbus/char/flash.c +++ b/drivers/sbus/char/flash.c @@ -17,7 +17,6 @@ #include <linux/of_device.h> #include <linux/uaccess.h> -#include <asm/pgtable.h> #include <asm/io.h> #include <asm/upa.h> diff --git a/drivers/sbus/char/uctrl.c b/drivers/sbus/char/uctrl.c index 37d252f2548d..05de0ce79cb9 100644 --- a/drivers/sbus/char/uctrl.c +++ b/drivers/sbus/char/uctrl.c @@ -21,7 +21,6 @@ #include <asm/oplib.h> #include <asm/irq.h> #include <asm/io.h> -#include <asm/pgtable.h> #define DEBUG 1 #ifdef DEBUG diff --git a/drivers/scsi/a2091.c b/drivers/scsi/a2091.c index 564b35473672..5853db36eceb 100644 --- a/drivers/scsi/a2091.c +++ b/drivers/scsi/a2091.c @@ -9,7 +9,6 @@ #include <linux/module.h> #include <asm/page.h> -#include <asm/pgtable.h> #include <asm/amigaints.h> #include <asm/amigahw.h> diff --git a/drivers/scsi/a3000.c b/drivers/scsi/a3000.c index b6a0432f305a..86f1da22aaa5 100644 --- a/drivers/scsi/a3000.c +++ b/drivers/scsi/a3000.c @@ -10,7 +10,6 @@ #include <linux/module.h> #include <asm/page.h> -#include <asm/pgtable.h> #include <asm/amigaints.h> #include <asm/amigahw.h> diff --git a/drivers/scsi/gvp11.c b/drivers/scsi/gvp11.c index 11df0eca0293..727f8c8f30b5 100644 --- a/drivers/scsi/gvp11.c +++ b/drivers/scsi/gvp11.c @@ -9,7 +9,6 @@ #include <linux/module.h> #include <asm/page.h> -#include <asm/pgtable.h> #include <asm/amigaints.h> #include <asm/amigahw.h> diff --git a/drivers/scsi/lasi700.c b/drivers/scsi/lasi700.c index c48a73a0f517..de71d240a56f 100644 --- a/drivers/scsi/lasi700.c +++ b/drivers/scsi/lasi700.c @@ -31,7 +31,6 @@ #include <linux/slab.h> #include <asm/page.h> -#include <asm/pgtable.h> #include <asm/irq.h> #include <asm/hardware.h> #include <asm/parisc-device.h> diff --git a/drivers/scsi/mvme147.c b/drivers/scsi/mvme147.c index ca96d6d9c350..869b8b058a43 100644 --- a/drivers/scsi/mvme147.c +++ b/drivers/scsi/mvme147.c @@ -8,7 +8,6 @@ #include <linux/module.h> #include <asm/page.h> -#include <asm/pgtable.h> #include <asm/mvme147hw.h> #include <asm/irq.h> diff --git a/drivers/scsi/sni_53c710.c b/drivers/scsi/sni_53c710.c index f8397978f8ab..03d43f016397 100644 --- a/drivers/scsi/sni_53c710.c +++ b/drivers/scsi/sni_53c710.c @@ -28,7 +28,6 @@ #include <linux/platform_device.h> #include <asm/page.h> -#include <asm/pgtable.h> #include <asm/irq.h> #include <asm/delay.h> diff --git a/drivers/video/console/newport_con.c b/drivers/video/console/newport_con.c index 00dddf6e08b0..504cda38763e 100644 --- a/drivers/video/console/newport_con.c +++ b/drivers/video/console/newport_con.c @@ -24,7 +24,6 @@ #include <asm/io.h> #include <linux/uaccess.h> #include <asm/page.h> -#include <asm/pgtable.h> #include <asm/gio_device.h> #include <video/newport.h> diff --git a/drivers/video/fbdev/acornfb.c b/drivers/video/fbdev/acornfb.c index a3af49529173..09a9ad901dad 100644 --- a/drivers/video/fbdev/acornfb.c +++ b/drivers/video/fbdev/acornfb.c @@ -30,7 +30,6 @@ #include <mach/hardware.h> #include <asm/irq.h> #include <asm/mach-types.h> -#include <asm/pgtable.h> #include "acornfb.h" diff --git a/drivers/video/fbdev/atafb.c b/drivers/video/fbdev/atafb.c index 51f5d1c56fd9..f253daa05d9d 100644 --- a/drivers/video/fbdev/atafb.c +++ b/drivers/video/fbdev/atafb.c @@ -58,7 +58,6 @@ #include <asm/setup.h> #include <linux/uaccess.h> -#include <asm/pgtable.h> #include <asm/irq.h> #include <asm/io.h> diff --git a/drivers/video/fbdev/cirrusfb.c b/drivers/video/fbdev/cirrusfb.c index c3a3e344cee3..3df64a973194 100644 --- a/drivers/video/fbdev/cirrusfb.c +++ b/drivers/video/fbdev/cirrusfb.c @@ -42,7 +42,6 @@ #include <linux/delay.h> #include <linux/fb.h> #include <linux/init.h> -#include <asm/pgtable.h> #ifdef CONFIG_ZORRO #include <linux/zorro.h> diff --git a/drivers/video/fbdev/cyber2000fb.c b/drivers/video/fbdev/cyber2000fb.c index 513f58f28b0f..42d37bed518a 100644 --- a/drivers/video/fbdev/cyber2000fb.c +++ b/drivers/video/fbdev/cyber2000fb.c @@ -47,7 +47,6 @@ #include <linux/i2c.h> #include <linux/i2c-algo-bit.h> -#include <asm/pgtable.h> #ifdef __arm__ #include <asm/mach-types.h> diff --git a/drivers/video/fbdev/fb-puv3.c b/drivers/video/fbdev/fb-puv3.c index 75df6aabac21..030e85c11a78 100644 --- a/drivers/video/fbdev/fb-puv3.c +++ b/drivers/video/fbdev/fb-puv3.c @@ -18,7 +18,6 @@ #include <linux/mm.h> #include <linux/sizes.h> -#include <asm/pgtable.h> #include <mach/hardware.h> /* Platform_data reserved for unifb registers. */ diff --git a/drivers/video/fbdev/hitfb.c b/drivers/video/fbdev/hitfb.c index 009e5d2aa100..bbb0f1d953cc 100644 --- a/drivers/video/fbdev/hitfb.c +++ b/drivers/video/fbdev/hitfb.c @@ -23,7 +23,6 @@ #include <asm/machvec.h> #include <linux/uaccess.h> -#include <asm/pgtable.h> #include <asm/io.h> #include <asm/hd64461.h> #include <cpu/dac.h> diff --git a/drivers/video/fbdev/neofb.c b/drivers/video/fbdev/neofb.c index e6ea853c1723..f5a676bfd67a 100644 --- a/drivers/video/fbdev/neofb.c +++ b/drivers/video/fbdev/neofb.c @@ -70,7 +70,6 @@ #include <asm/io.h> #include <asm/irq.h> -#include <asm/pgtable.h> #include <video/vga.h> #include <video/neomagic.h> diff --git a/drivers/video/fbdev/q40fb.c b/drivers/video/fbdev/q40fb.c index 79ff14a35c85..079a2a7fb2c5 100644 --- a/drivers/video/fbdev/q40fb.c +++ b/drivers/video/fbdev/q40fb.c @@ -23,7 +23,6 @@ #include <asm/q40_master.h> #include <linux/fb.h> #include <linux/module.h> -#include <asm/pgtable.h> #define Q40_PHYS_SCREEN_ADDR 0xFE800000 diff --git a/drivers/video/fbdev/savage/savagefb_driver.c b/drivers/video/fbdev/savage/savagefb_driver.c index aab312a7d9da..3c8ae87f0ea7 100644 --- a/drivers/video/fbdev/savage/savagefb_driver.c +++ b/drivers/video/fbdev/savage/savagefb_driver.c @@ -55,7 +55,6 @@ #include <asm/io.h> #include <asm/irq.h> -#include <asm/pgtable.h> #include "savagefb.h" diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index 0c142bcab79d..77c57568e5d7 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c @@ -59,7 +59,6 @@ #include <asm/page.h> #include <asm/pgalloc.h> -#include <asm/pgtable.h> #include <asm/tlb.h> #include <asm/xen/hypervisor.h> diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c index 7b36b51cdb9f..8d06bf1cc347 100644 --- a/drivers/xen/grant-table.c +++ b/drivers/xen/grant-table.c @@ -64,7 +64,6 @@ #include <asm/xen/hypercall.h> #include <asm/xen/interface.h> -#include <asm/pgtable.h> #include <asm/sync_bitops.h> /* External tools reserve first few grant table entries. */ diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c index b8ccb8990bfd..989ae9bd02c0 100644 --- a/drivers/xen/privcmd.c +++ b/drivers/xen/privcmd.c @@ -26,7 +26,6 @@ #include <linux/moduleparam.h> #include <asm/pgalloc.h> -#include <asm/pgtable.h> #include <asm/xen/hypervisor.h> #include <asm/xen/hypercall.h> diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c index 8c4d05b687b7..dc81e9926a76 100644 --- a/drivers/xen/xenbus/xenbus_probe.c +++ b/drivers/xen/xenbus/xenbus_probe.c @@ -51,7 +51,6 @@ #include <linux/module.h> #include <asm/page.h> -#include <asm/pgtable.h> #include <asm/xen/hypervisor.h> #include <xen/xen.h> diff --git a/drivers/xen/xenbus/xenbus_probe_backend.c b/drivers/xen/xenbus/xenbus_probe_backend.c index 9b2fbe69bccc..2ba699897e6d 100644 --- a/drivers/xen/xenbus/xenbus_probe_backend.c +++ b/drivers/xen/xenbus/xenbus_probe_backend.c @@ -48,7 +48,6 @@ #include <linux/semaphore.h> #include <asm/page.h> -#include <asm/pgtable.h> #include <asm/xen/hypervisor.h> #include <asm/hypervisor.h> #include <xen/xenbus.h> diff --git a/drivers/xen/xenbus/xenbus_probe_frontend.c b/drivers/xen/xenbus/xenbus_probe_frontend.c index 8a1650bbe18f..15379089853b 100644 --- a/drivers/xen/xenbus/xenbus_probe_frontend.c +++ b/drivers/xen/xenbus/xenbus_probe_frontend.c @@ -19,7 +19,6 @@ #include <linux/module.h> #include <asm/page.h> -#include <asm/pgtable.h> #include <asm/xen/hypervisor.h> #include <xen/xenbus.h> #include <xen/events.h> |