From e31cf2f4ca422ac9b14ecc4a1295b8977a20f812 Mon Sep 17 00:00:00 2001 From: Mike Rapoport Date: Mon, 8 Jun 2020 21:32:33 -0700 Subject: 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 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 in the files that include . The include statements in such cases are remove with a simple loop: for f in $(git grep -l "include ") ; do sed -i -e '/include / d' $f done Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Brian Cain Cc: Catalin Marinas Cc: Chris Zankel Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greentime Hu Cc: Greg Ungerer Cc: Guan Xuetao Cc: Guo Ren Cc: Heiko Carstens Cc: Helge Deller Cc: Ingo Molnar Cc: Ley Foon Tan Cc: Mark Salter Cc: Matthew Wilcox Cc: Matt Turner Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Mike Rapoport Cc: Nick Hu Cc: Paul Walmsley Cc: Richard Weinberger Cc: Rich Felker Cc: Russell King Cc: Stafford Horne Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Tony Luck Cc: Vincent Chen Cc: Vineet Gupta Cc: Will Deacon Cc: Yoshinori Sato 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 --- drivers/char/agp/frontend.c | 1 - drivers/char/agp/generic.c | 1 - drivers/char/bsr.c | 1 - drivers/char/mspec.c | 1 - drivers/gpu/drm/i915/i915_mm.c | 1 - drivers/infiniband/sw/rdmavt/mmap.c | 1 - drivers/infiniband/sw/rxe/rxe_mmap.c | 1 - drivers/media/platform/davinci/vpbe_display.c | 1 - drivers/media/v4l2-core/v4l2-common.c | 1 - drivers/misc/sgi-gru/grufault.c | 1 - drivers/net/ethernet/sun/sunhme.c | 1 - drivers/sbus/char/flash.c | 1 - drivers/sbus/char/uctrl.c | 1 - drivers/scsi/a2091.c | 1 - drivers/scsi/a3000.c | 1 - drivers/scsi/gvp11.c | 1 - drivers/scsi/lasi700.c | 1 - drivers/scsi/mvme147.c | 1 - drivers/scsi/sni_53c710.c | 1 - drivers/video/console/newport_con.c | 1 - drivers/video/fbdev/acornfb.c | 1 - drivers/video/fbdev/atafb.c | 1 - drivers/video/fbdev/cirrusfb.c | 1 - drivers/video/fbdev/cyber2000fb.c | 1 - drivers/video/fbdev/fb-puv3.c | 1 - drivers/video/fbdev/hitfb.c | 1 - drivers/video/fbdev/neofb.c | 1 - drivers/video/fbdev/q40fb.c | 1 - drivers/video/fbdev/savage/savagefb_driver.c | 1 - drivers/xen/balloon.c | 1 - drivers/xen/grant-table.c | 1 - drivers/xen/privcmd.c | 1 - drivers/xen/xenbus/xenbus_probe.c | 1 - drivers/xen/xenbus/xenbus_probe_backend.c | 1 - drivers/xen/xenbus/xenbus_probe_frontend.c | 1 - 35 files changed, 35 deletions(-) (limited to 'drivers') 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 #include #include -#include #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 #endif -#include #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 #include #include -#include #include /* 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 #include #include -#include #include #include #include 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 #include -#include #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 #include #include -#include #include #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 #include #include -#include #include #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 #include -#include #include #include 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 #include #include -#include #include #include #include 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 #include #include -#include #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 -#include #include #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 #include -#include #include #include 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 #include #include -#include #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 #include -#include #include #include 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 #include -#include #include #include 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 #include -#include #include #include 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 #include -#include #include #include #include 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 #include -#include #include #include 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 #include -#include #include #include 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 #include #include -#include #include #include