Commit a7c61a34 authored by Jisheng Zhang's avatar Jisheng Zhang Committed by Will Deacon

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: default avatarJisheng Zhang <jszhang@marvell.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent 76c714be
...@@ -62,7 +62,7 @@ struct insn_emulation { ...@@ -62,7 +62,7 @@ struct insn_emulation {
}; };
static LIST_HEAD(insn_emulation); static LIST_HEAD(insn_emulation);
static int nr_insn_emulated; static int nr_insn_emulated __initdata;
static DEFINE_RAW_SPINLOCK(insn_emulation_lock); static DEFINE_RAW_SPINLOCK(insn_emulation_lock);
static void register_emulation_hooks(struct insn_emulation_ops *ops) static void register_emulation_hooks(struct insn_emulation_ops *ops)
...@@ -173,7 +173,7 @@ static int update_insn_emulation_mode(struct insn_emulation *insn, ...@@ -173,7 +173,7 @@ static int update_insn_emulation_mode(struct insn_emulation *insn,
return ret; return ret;
} }
static void register_insn_emulation(struct insn_emulation_ops *ops) static void __init register_insn_emulation(struct insn_emulation_ops *ops)
{ {
unsigned long flags; unsigned long flags;
struct insn_emulation *insn; struct insn_emulation *insn;
...@@ -237,7 +237,7 @@ static struct ctl_table ctl_abi[] = { ...@@ -237,7 +237,7 @@ static struct ctl_table ctl_abi[] = {
{ } { }
}; };
static void register_insn_emulation_sysctl(struct ctl_table *table) static void __init register_insn_emulation_sysctl(struct ctl_table *table)
{ {
unsigned long flags; unsigned long flags;
int i = 0; int i = 0;
......
...@@ -684,7 +684,7 @@ static const struct arm64_cpu_capabilities arm64_hwcaps[] = { ...@@ -684,7 +684,7 @@ static const struct arm64_cpu_capabilities arm64_hwcaps[] = {
{}, {},
}; };
static void cap_set_hwcap(const struct arm64_cpu_capabilities *cap) static void __init cap_set_hwcap(const struct arm64_cpu_capabilities *cap)
{ {
switch (cap->hwcap_type) { switch (cap->hwcap_type) {
case CAP_HWCAP: case CAP_HWCAP:
...@@ -729,7 +729,7 @@ static bool __maybe_unused cpus_have_hwcap(const struct arm64_cpu_capabilities * ...@@ -729,7 +729,7 @@ static bool __maybe_unused cpus_have_hwcap(const struct arm64_cpu_capabilities *
return rc; return rc;
} }
static void setup_cpu_hwcaps(void) static void __init setup_cpu_hwcaps(void)
{ {
int i; int i;
const struct arm64_cpu_capabilities *hwcaps = arm64_hwcaps; const struct arm64_cpu_capabilities *hwcaps = arm64_hwcaps;
...@@ -758,7 +758,8 @@ void update_cpu_capabilities(const struct arm64_cpu_capabilities *caps, ...@@ -758,7 +758,8 @@ void update_cpu_capabilities(const struct arm64_cpu_capabilities *caps,
* Run through the enabled capabilities and enable() it on all active * Run through the enabled capabilities and enable() it on all active
* CPUs * CPUs
*/ */
static void enable_cpu_capabilities(const struct arm64_cpu_capabilities *caps) static void __init
enable_cpu_capabilities(const struct arm64_cpu_capabilities *caps)
{ {
int i; int i;
...@@ -897,7 +898,7 @@ static inline void set_sys_caps_initialised(void) ...@@ -897,7 +898,7 @@ static inline void set_sys_caps_initialised(void)
#endif /* CONFIG_HOTPLUG_CPU */ #endif /* CONFIG_HOTPLUG_CPU */
static void setup_feature_capabilities(void) static void __init setup_feature_capabilities(void)
{ {
update_cpu_capabilities(arm64_features, "detected feature:"); update_cpu_capabilities(arm64_features, "detected feature:");
enable_cpu_capabilities(arm64_features); enable_cpu_capabilities(arm64_features);
......
...@@ -289,7 +289,7 @@ static struct notifier_block fpsimd_cpu_pm_notifier_block = { ...@@ -289,7 +289,7 @@ static struct notifier_block fpsimd_cpu_pm_notifier_block = {
.notifier_call = fpsimd_cpu_pm_notifier, .notifier_call = fpsimd_cpu_pm_notifier,
}; };
static void fpsimd_pm_init(void) static void __init fpsimd_pm_init(void)
{ {
cpu_pm_register_notifier(&fpsimd_cpu_pm_notifier_block); cpu_pm_register_notifier(&fpsimd_cpu_pm_notifier_block);
} }
......
...@@ -40,7 +40,7 @@ static pgprot_t __get_dma_pgprot(struct dma_attrs *attrs, pgprot_t prot, ...@@ -40,7 +40,7 @@ static pgprot_t __get_dma_pgprot(struct dma_attrs *attrs, pgprot_t prot,
static struct gen_pool *atomic_pool; static struct gen_pool *atomic_pool;
#define DEFAULT_DMA_COHERENT_POOL_SIZE SZ_256K #define DEFAULT_DMA_COHERENT_POOL_SIZE SZ_256K
static size_t atomic_pool_size = DEFAULT_DMA_COHERENT_POOL_SIZE; static size_t atomic_pool_size __initdata = DEFAULT_DMA_COHERENT_POOL_SIZE;
static int __init early_coherent_pool(char *p) static int __init early_coherent_pool(char *p)
{ {
...@@ -896,7 +896,7 @@ static int __iommu_attach_notifier(struct notifier_block *nb, ...@@ -896,7 +896,7 @@ static int __iommu_attach_notifier(struct notifier_block *nb,
return 0; return 0;
} }
static int register_iommu_dma_ops_notifier(struct bus_type *bus) static int __init register_iommu_dma_ops_notifier(struct bus_type *bus)
{ {
struct notifier_block *nb = kzalloc(sizeof(*nb), GFP_KERNEL); struct notifier_block *nb = kzalloc(sizeof(*nb), GFP_KERNEL);
int ret; int ret;
......
...@@ -71,7 +71,7 @@ early_param("initrd", early_initrd); ...@@ -71,7 +71,7 @@ early_param("initrd", early_initrd);
* currently assumes that for memory starting above 4G, 32-bit devices will * currently assumes that for memory starting above 4G, 32-bit devices will
* use a DMA offset. * use a DMA offset.
*/ */
static phys_addr_t max_zone_dma_phys(void) static phys_addr_t __init max_zone_dma_phys(void)
{ {
phys_addr_t offset = memblock_start_of_DRAM() & GENMASK_ULL(63, 32); phys_addr_t offset = memblock_start_of_DRAM() & GENMASK_ULL(63, 32);
return min(offset + (1ULL << 32), memblock_end_of_DRAM()); return min(offset + (1ULL << 32), memblock_end_of_DRAM());
...@@ -126,11 +126,11 @@ EXPORT_SYMBOL(pfn_valid); ...@@ -126,11 +126,11 @@ EXPORT_SYMBOL(pfn_valid);
#endif #endif
#ifndef CONFIG_SPARSEMEM #ifndef CONFIG_SPARSEMEM
static void arm64_memory_present(void) static void __init arm64_memory_present(void)
{ {
} }
#else #else
static void arm64_memory_present(void) static void __init arm64_memory_present(void)
{ {
struct memblock_region *reg; struct memblock_region *reg;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment