arm64: mm: mark create_mapping as __init
authorMark Rutland <mark.rutland@arm.com>
Tue, 28 Jul 2015 09:31:06 +0000 (10:31 +0100)
committerWill Deacon <will.deacon@arm.com>
Tue, 28 Jul 2015 10:36:09 +0000 (11:36 +0100)
Currently create_mapping is marked with __ref, apparently because it
refers to early_alloc. However, create_mapping has no logic to prevent
erroneous use of early_alloc after it has been freed, and is only ever
called by __init functions anyway. Thus the __ref marker is misleading
and unnecessary.

Instead, this patch marks create_mapping as __init, resulting in
warnings if it is used from a a non __init functions, and allowing its
memory to be reclaimed.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/mm/mmu.c

index 63012fed46fc04ce0eecb48791ec82e46f4ef101..9211b8527f2580aeb561b8c7cc3cdc75f728571f 100644 (file)
@@ -267,7 +267,7 @@ static void *late_alloc(unsigned long size)
        return ptr;
 }
 
-static void __ref create_mapping(phys_addr_t phys, unsigned long virt,
+static void __init create_mapping(phys_addr_t phys, unsigned long virt,
                                  phys_addr_t size, pgprot_t prot)
 {
        if (virt < VMALLOC_START) {