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

arm64: add __init/__initdata section marker to some functions/variables

These functions/variables are not needed after booting, so mark them
as __init or __initdata.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>

authored by

Jisheng Zhang and committed by
Will Deacon
a7c61a34 76c714be

+14 -13
+3 -3
arch/arm64/kernel/armv8_deprecated.c
··· 62 62 }; 63 63 64 64 static LIST_HEAD(insn_emulation); 65 - static int nr_insn_emulated; 65 + static int nr_insn_emulated __initdata; 66 66 static DEFINE_RAW_SPINLOCK(insn_emulation_lock); 67 67 68 68 static void register_emulation_hooks(struct insn_emulation_ops *ops) ··· 173 173 return ret; 174 174 } 175 175 176 - static void register_insn_emulation(struct insn_emulation_ops *ops) 176 + static void __init register_insn_emulation(struct insn_emulation_ops *ops) 177 177 { 178 178 unsigned long flags; 179 179 struct insn_emulation *insn; ··· 237 237 { } 238 238 }; 239 239 240 - static void register_insn_emulation_sysctl(struct ctl_table *table) 240 + static void __init register_insn_emulation_sysctl(struct ctl_table *table) 241 241 { 242 242 unsigned long flags; 243 243 int i = 0;
+5 -4
arch/arm64/kernel/cpufeature.c
··· 684 684 {}, 685 685 }; 686 686 687 - static void cap_set_hwcap(const struct arm64_cpu_capabilities *cap) 687 + static void __init cap_set_hwcap(const struct arm64_cpu_capabilities *cap) 688 688 { 689 689 switch (cap->hwcap_type) { 690 690 case CAP_HWCAP: ··· 729 729 return rc; 730 730 } 731 731 732 - static void setup_cpu_hwcaps(void) 732 + static void __init setup_cpu_hwcaps(void) 733 733 { 734 734 int i; 735 735 const struct arm64_cpu_capabilities *hwcaps = arm64_hwcaps; ··· 758 758 * Run through the enabled capabilities and enable() it on all active 759 759 * CPUs 760 760 */ 761 - static void enable_cpu_capabilities(const struct arm64_cpu_capabilities *caps) 761 + static void __init 762 + enable_cpu_capabilities(const struct arm64_cpu_capabilities *caps) 762 763 { 763 764 int i; 764 765 ··· 898 897 899 898 #endif /* CONFIG_HOTPLUG_CPU */ 900 899 901 - static void setup_feature_capabilities(void) 900 + static void __init setup_feature_capabilities(void) 902 901 { 903 902 update_cpu_capabilities(arm64_features, "detected feature:"); 904 903 enable_cpu_capabilities(arm64_features);
+1 -1
arch/arm64/kernel/fpsimd.c
··· 289 289 .notifier_call = fpsimd_cpu_pm_notifier, 290 290 }; 291 291 292 - static void fpsimd_pm_init(void) 292 + static void __init fpsimd_pm_init(void) 293 293 { 294 294 cpu_pm_register_notifier(&fpsimd_cpu_pm_notifier_block); 295 295 }
+2 -2
arch/arm64/mm/dma-mapping.c
··· 40 40 static struct gen_pool *atomic_pool; 41 41 42 42 #define DEFAULT_DMA_COHERENT_POOL_SIZE SZ_256K 43 - static size_t atomic_pool_size = DEFAULT_DMA_COHERENT_POOL_SIZE; 43 + static size_t atomic_pool_size __initdata = DEFAULT_DMA_COHERENT_POOL_SIZE; 44 44 45 45 static int __init early_coherent_pool(char *p) 46 46 { ··· 896 896 return 0; 897 897 } 898 898 899 - static int register_iommu_dma_ops_notifier(struct bus_type *bus) 899 + static int __init register_iommu_dma_ops_notifier(struct bus_type *bus) 900 900 { 901 901 struct notifier_block *nb = kzalloc(sizeof(*nb), GFP_KERNEL); 902 902 int ret;
+3 -3
arch/arm64/mm/init.c
··· 71 71 * currently assumes that for memory starting above 4G, 32-bit devices will 72 72 * use a DMA offset. 73 73 */ 74 - static phys_addr_t max_zone_dma_phys(void) 74 + static phys_addr_t __init max_zone_dma_phys(void) 75 75 { 76 76 phys_addr_t offset = memblock_start_of_DRAM() & GENMASK_ULL(63, 32); 77 77 return min(offset + (1ULL << 32), memblock_end_of_DRAM()); ··· 126 126 #endif 127 127 128 128 #ifndef CONFIG_SPARSEMEM 129 - static void arm64_memory_present(void) 129 + static void __init arm64_memory_present(void) 130 130 { 131 131 } 132 132 #else 133 - static void arm64_memory_present(void) 133 + static void __init arm64_memory_present(void) 134 134 { 135 135 struct memblock_region *reg; 136 136