Skip to content

Commit 8bd26e3

Browse files
author
Paul Gortmaker
committed
arm: delete __cpuinit/__CPUINIT usage from all ARM users
The __cpuinit type of throwaway sections might have made sense some time ago when RAM was more constrained, but now the savings do not offset the cost and complications. For example, the fix in commit 5e427ec ("x86: Fix bit corruption at CPU resume time") is a good example of the nasty type of bugs that can be created with improper use of the various __init prefixes. After a discussion on LKML[1] it was decided that cpuinit should go the way of devinit and be phased out. Once all the users are gone, we can then finally remove the macros themselves from linux/init.h. Note that some harmless section mismatch warnings may result, since notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c) and are flagged as __cpuinit -- so if we remove the __cpuinit from the arch specific callers, we will also get section mismatch warnings. As an intermediate step, we intend to turn the linux/init.h cpuinit related content into no-ops as early as possible, since that will get rid of these warnings. In any case, they are temporary and harmless. This removes all the ARM uses of the __cpuinit macros from C code, and all __CPUINIT from assembly code. It also had two ".previous" section statements that were paired off against __CPUINIT (aka .section ".cpuinit.text") that also get removed here. [1] https://lkml.org/lkml/2013/5/20/589 Cc: Russell King <linux@arm.linux.org.uk> Cc: Will Deacon <will.deacon@arm.com> Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
1 parent 078a55f commit 8bd26e3

70 files changed

Lines changed: 64 additions & 140 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/arm/common/mcpm_platsmp.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <asm/smp.h>
2020
#include <asm/smp_plat.h>
2121

22-
static int __cpuinit mcpm_boot_secondary(unsigned int cpu, struct task_struct *idle)
22+
static int mcpm_boot_secondary(unsigned int cpu, struct task_struct *idle)
2323
{
2424
unsigned int mpidr, pcpu, pcluster, ret;
2525
extern void secondary_startup(void);
@@ -40,7 +40,7 @@ static int __cpuinit mcpm_boot_secondary(unsigned int cpu, struct task_struct *i
4040
return 0;
4141
}
4242

43-
static void __cpuinit mcpm_secondary_init(unsigned int cpu)
43+
static void mcpm_secondary_init(unsigned int cpu)
4444
{
4545
mcpm_cpu_powered_up();
4646
}

‎arch/arm/include/asm/arch_timer.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static inline u64 arch_counter_get_cntvct(void)
8989
return cval;
9090
}
9191

92-
static inline void __cpuinit arch_counter_set_user_access(void)
92+
static inline void arch_counter_set_user_access(void)
9393
{
9494
u32 cntkctl;
9595

‎arch/arm/kernel/head-common.S‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ ENDPROC(lookup_processor_type)
149149
* r5 = proc_info pointer in physical address space
150150
* r9 = cpuid (preserved)
151151
*/
152-
__CPUINIT
153152
__lookup_processor_type:
154153
adr r3, __lookup_processor_type_data
155154
ldmia r3, {r4 - r6}

‎arch/arm/kernel/head-nommu.S‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ ENTRY(stext)
8787
ENDPROC(stext)
8888

8989
#ifdef CONFIG_SMP
90-
__CPUINIT
9190
ENTRY(secondary_startup)
9291
/*
9392
* Common entry point for secondary CPUs.

‎arch/arm/kernel/head.S‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,6 @@ __turn_mmu_on_loc:
343343
.long __turn_mmu_on_end
344344

345345
#if defined(CONFIG_SMP)
346-
__CPUINIT
347346
ENTRY(secondary_startup)
348347
/*
349348
* Common entry point for secondary CPUs.

‎arch/arm/kernel/hw_breakpoint.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,7 @@ static void reset_ctrl_regs(void *unused)
10201020
cpumask_or(&debug_err_mask, &debug_err_mask, cpumask_of(cpu));
10211021
}
10221022

1023-
static int __cpuinit dbg_reset_notify(struct notifier_block *self,
1023+
static int dbg_reset_notify(struct notifier_block *self,
10241024
unsigned long action, void *cpu)
10251025
{
10261026
if ((action & ~CPU_TASKS_FROZEN) == CPU_ONLINE)
@@ -1029,7 +1029,7 @@ static int __cpuinit dbg_reset_notify(struct notifier_block *self,
10291029
return NOTIFY_OK;
10301030
}
10311031

1032-
static struct notifier_block __cpuinitdata dbg_reset_nb = {
1032+
static struct notifier_block dbg_reset_nb = {
10331033
.notifier_call = dbg_reset_notify,
10341034
};
10351035

‎arch/arm/kernel/perf_event_cpu.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ static void cpu_pmu_init(struct arm_pmu *cpu_pmu)
157157
* UNKNOWN at reset, the PMU must be explicitly reset to avoid reading
158158
* junk values out of them.
159159
*/
160-
static int __cpuinit cpu_pmu_notify(struct notifier_block *b,
161-
unsigned long action, void *hcpu)
160+
static int cpu_pmu_notify(struct notifier_block *b, unsigned long action,
161+
void *hcpu)
162162
{
163163
if ((action & ~CPU_TASKS_FROZEN) != CPU_STARTING)
164164
return NOTIFY_DONE;
@@ -171,7 +171,7 @@ static int __cpuinit cpu_pmu_notify(struct notifier_block *b,
171171
return NOTIFY_OK;
172172
}
173173

174-
static struct notifier_block __cpuinitdata cpu_pmu_hotplug_notifier = {
174+
static struct notifier_block cpu_pmu_hotplug_notifier = {
175175
.notifier_call = cpu_pmu_notify,
176176
};
177177

‎arch/arm/kernel/psci_smp.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@
4646

4747
extern void secondary_startup(void);
4848

49-
static int __cpuinit psci_boot_secondary(unsigned int cpu,
50-
struct task_struct *idle)
49+
static int psci_boot_secondary(unsigned int cpu, struct task_struct *idle)
5150
{
5251
if (psci_ops.cpu_on)
5352
return psci_ops.cpu_on(cpu_logical_map(cpu),

‎arch/arm/kernel/smp.c‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ struct secondary_data secondary_data;
5858
* control for which core is the next to come out of the secondary
5959
* boot "holding pen"
6060
*/
61-
volatile int __cpuinitdata pen_release = -1;
61+
volatile int pen_release = -1;
6262

6363
enum ipi_msg_type {
6464
IPI_WAKEUP,
@@ -86,7 +86,7 @@ static unsigned long get_arch_pgd(pgd_t *pgd)
8686
return pgdir >> ARCH_PGD_SHIFT;
8787
}
8888

89-
int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *idle)
89+
int __cpu_up(unsigned int cpu, struct task_struct *idle)
9090
{
9191
int ret;
9292

@@ -138,7 +138,7 @@ void __init smp_init_cpus(void)
138138
smp_ops.smp_init_cpus();
139139
}
140140

141-
int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
141+
int boot_secondary(unsigned int cpu, struct task_struct *idle)
142142
{
143143
if (smp_ops.smp_boot_secondary)
144144
return smp_ops.smp_boot_secondary(cpu, idle);
@@ -170,7 +170,7 @@ static int platform_cpu_disable(unsigned int cpu)
170170
/*
171171
* __cpu_disable runs on the processor to be shutdown.
172172
*/
173-
int __cpuinit __cpu_disable(void)
173+
int __cpu_disable(void)
174174
{
175175
unsigned int cpu = smp_processor_id();
176176
int ret;
@@ -216,7 +216,7 @@ static DECLARE_COMPLETION(cpu_died);
216216
* called on the thread which is asking for a CPU to be shutdown -
217217
* waits until shutdown has completed, or it is timed out.
218218
*/
219-
void __cpuinit __cpu_die(unsigned int cpu)
219+
void __cpu_die(unsigned int cpu)
220220
{
221221
if (!wait_for_completion_timeout(&cpu_died, msecs_to_jiffies(5000))) {
222222
pr_err("CPU%u: cpu didn't die\n", cpu);
@@ -306,7 +306,7 @@ void __ref cpu_die(void)
306306
* Called by both boot and secondaries to move global data into
307307
* per-processor storage.
308308
*/
309-
static void __cpuinit smp_store_cpu_info(unsigned int cpuid)
309+
static void smp_store_cpu_info(unsigned int cpuid)
310310
{
311311
struct cpuinfo_arm *cpu_info = &per_cpu(cpu_data, cpuid);
312312

@@ -322,7 +322,7 @@ static void percpu_timer_setup(void);
322322
* This is the secondary CPU boot entry. We're using this CPUs
323323
* idle thread stack, but a set of temporary page tables.
324324
*/
325-
asmlinkage void __cpuinit secondary_start_kernel(void)
325+
asmlinkage void secondary_start_kernel(void)
326326
{
327327
struct mm_struct *mm = &init_mm;
328328
unsigned int cpu;
@@ -521,7 +521,7 @@ static void broadcast_timer_set_mode(enum clock_event_mode mode,
521521
{
522522
}
523523

524-
static void __cpuinit broadcast_timer_setup(struct clock_event_device *evt)
524+
static void broadcast_timer_setup(struct clock_event_device *evt)
525525
{
526526
evt->name = "dummy_timer";
527527
evt->features = CLOCK_EVT_FEAT_ONESHOT |
@@ -550,7 +550,7 @@ int local_timer_register(struct local_timer_ops *ops)
550550
}
551551
#endif
552552

553-
static void __cpuinit percpu_timer_setup(void)
553+
static void percpu_timer_setup(void)
554554
{
555555
unsigned int cpu = smp_processor_id();
556556
struct clock_event_device *evt = &per_cpu(percpu_clockevent, cpu);

‎arch/arm/kernel/smp_twd.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ core_initcall(twd_cpufreq_init);
187187

188188
#endif
189189

190-
static void __cpuinit twd_calibrate_rate(void)
190+
static void twd_calibrate_rate(void)
191191
{
192192
unsigned long count;
193193
u64 waitjiffies;
@@ -265,7 +265,7 @@ static void twd_get_clock(struct device_node *np)
265265
/*
266266
* Setup the local clock events for a CPU.
267267
*/
268-
static int __cpuinit twd_timer_setup(struct clock_event_device *clk)
268+
static int twd_timer_setup(struct clock_event_device *clk)
269269
{
270270
struct clock_event_device **this_cpu_clk;
271271
int cpu = smp_processor_id();
@@ -308,7 +308,7 @@ static int __cpuinit twd_timer_setup(struct clock_event_device *clk)
308308
return 0;
309309
}
310310

311-
static struct local_timer_ops twd_lt_ops __cpuinitdata = {
311+
static struct local_timer_ops twd_lt_ops = {
312312
.setup = twd_timer_setup,
313313
.stop = twd_timer_stop,
314314
};

0 commit comments

Comments
 (0)