arm64: mm: drop fixup_init() and mm.h
authorKefeng Wang <wangkefeng.wang@huawei.com>
Mon, 5 Sep 2016 11:30:22 +0000 (19:30 +0800)
committerWill Deacon <will.deacon@arm.com>
Tue, 6 Sep 2016 18:09:38 +0000 (19:09 +0100)
There is only fixup_init() in mm.h , and it is only called
in free_initmem(), so move the codes from fixup_init() into
free_initmem(), then drop fixup_init() and mm.h.

Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/mm/flush.c
arch/arm64/mm/init.c
arch/arm64/mm/mm.h [deleted file]
arch/arm64/mm/mmu.c
arch/arm64/mm/pgd.c

index 43a76b07eb32dc9c6324c53ddcc601283c6005b2..8377329d8c97a6b9709865f2e448951b22cd2478 100644 (file)
@@ -25,8 +25,6 @@
 #include <asm/cachetype.h>
 #include <asm/tlbflush.h>
 
-#include "mm.h"
-
 void flush_cache_range(struct vm_area_struct *vma, unsigned long start,
                       unsigned long end)
 {
index 251e0824cd82fc089c3f7a7db0130a5067fa59af..21c489bdeb4ee03d0a126070452c92b1aca6a1b6 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/dma-contiguous.h>
 #include <linux/efi.h>
 #include <linux/swiotlb.h>
+#include <linux/vmalloc.h>
 
 #include <asm/boot.h>
 #include <asm/fixmap.h>
@@ -48,8 +49,6 @@
 #include <asm/tlb.h>
 #include <asm/alternative.h>
 
-#include "mm.h"
-
 /*
  * We need to be able to catch inadvertent references to memstart_addr
  * that occur (potentially in generic code) before arm64_memblock_init()
@@ -486,7 +485,12 @@ void free_initmem(void)
 {
        free_reserved_area(__va(__pa(__init_begin)), __va(__pa(__init_end)),
                           0, "unused kernel");
-       fixup_init();
+       /*
+        * Unmap the __init region but leave the VM area in place. This
+        * prevents the region from being reused for kernel modules, which
+        * is not supported by kallsyms.
+        */
+       unmap_kernel_range((u64)__init_begin, (u64)(__init_end - __init_begin));
 }
 
 #ifdef CONFIG_BLK_DEV_INITRD
diff --git a/arch/arm64/mm/mm.h b/arch/arm64/mm/mm.h
deleted file mode 100644 (file)
index 71fe989..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-
-void fixup_init(void);
index e634a0f6d62b2bc4b0d9e39bd58bd709ba429ab4..05615a3fdc6ffeb00717ff42325c5d4a1f11d1b1 100644 (file)
@@ -43,8 +43,6 @@
 #include <asm/memblock.h>
 #include <asm/mmu_context.h>
 
-#include "mm.h"
-
 u64 idmap_t0sz = TCR_T0SZ(VA_BITS);
 
 u64 kimage_voffset __ro_after_init;
@@ -400,16 +398,6 @@ void mark_rodata_ro(void)
                            section_size, PAGE_KERNEL_RO);
 }
 
-void fixup_init(void)
-{
-       /*
-        * Unmap the __init region but leave the VM area in place. This
-        * prevents the region from being reused for kernel modules, which
-        * is not supported by kallsyms.
-        */
-       unmap_kernel_range((u64)__init_begin, (u64)(__init_end - __init_begin));
-}
-
 static void __init map_kernel_segment(pgd_t *pgd, void *va_start, void *va_end,
                                      pgprot_t prot, struct vm_struct *vma)
 {
index ae11d4e03d0e68d7f0fe621f1c9d313fcab09127..371c5f03a1708c172e731abb07637e369681fec1 100644 (file)
@@ -26,8 +26,6 @@
 #include <asm/page.h>
 #include <asm/tlbflush.h>
 
-#include "mm.h"
-
 static struct kmem_cache *pgd_cache;
 
 pgd_t *pgd_alloc(struct mm_struct *mm)