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

clocksource+irqchip: delete __cpuinit usage from all related files

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 5e427ec2d0 ("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.

This removes all the drivers/clocksource and drivers/irqchip uses of
the __cpuinit macros from all C files.

[1] https://lkml.org/lkml/2013/5/20/589

Cc: John Stultz <john.stultz@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

+24 -24
+4 -4
drivers/clocksource/arm_arch_timer.c
··· 123 123 return 0; 124 124 } 125 125 126 - static int __cpuinit arch_timer_setup(struct clock_event_device *clk) 126 + static int arch_timer_setup(struct clock_event_device *clk) 127 127 { 128 128 clk->features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_C3STOP; 129 129 clk->name = "arch_sys_timer"; ··· 221 221 return &timecounter; 222 222 } 223 223 224 - static void __cpuinit arch_timer_stop(struct clock_event_device *clk) 224 + static void arch_timer_stop(struct clock_event_device *clk) 225 225 { 226 226 pr_debug("arch_timer_teardown disable IRQ%d cpu #%d\n", 227 227 clk->irq, smp_processor_id()); ··· 237 237 clk->set_mode(CLOCK_EVT_MODE_UNUSED, clk); 238 238 } 239 239 240 - static int __cpuinit arch_timer_cpu_notify(struct notifier_block *self, 240 + static int arch_timer_cpu_notify(struct notifier_block *self, 241 241 unsigned long action, void *hcpu) 242 242 { 243 243 /* ··· 256 256 return NOTIFY_OK; 257 257 } 258 258 259 - static struct notifier_block arch_timer_cpu_nb __cpuinitdata = { 259 + static struct notifier_block arch_timer_cpu_nb = { 260 260 .notifier_call = arch_timer_cpu_notify, 261 261 }; 262 262
+4 -4
drivers/clocksource/arm_global_timer.c
··· 164 164 return IRQ_HANDLED; 165 165 } 166 166 167 - static int __cpuinit gt_clockevents_init(struct clock_event_device *clk) 167 + static int gt_clockevents_init(struct clock_event_device *clk) 168 168 { 169 169 int cpu = smp_processor_id(); 170 170 ··· 221 221 clocksource_register_hz(&gt_clocksource, gt_clk_rate); 222 222 } 223 223 224 - static int __cpuinit gt_cpu_notify(struct notifier_block *self, 225 - unsigned long action, void *hcpu) 224 + static int gt_cpu_notify(struct notifier_block *self, unsigned long action, 225 + void *hcpu) 226 226 { 227 227 switch (action & ~CPU_TASKS_FROZEN) { 228 228 case CPU_STARTING: ··· 235 235 236 236 return NOTIFY_OK; 237 237 } 238 - static struct notifier_block gt_cpu_nb __cpuinitdata = { 238 + static struct notifier_block gt_cpu_nb = { 239 239 .notifier_call = gt_cpu_notify, 240 240 }; 241 241
+3 -3
drivers/clocksource/dummy_timer.c
··· 25 25 */ 26 26 } 27 27 28 - static void __cpuinit dummy_timer_setup(void) 28 + static void dummy_timer_setup(void) 29 29 { 30 30 int cpu = smp_processor_id(); 31 31 struct clock_event_device *evt = __this_cpu_ptr(&dummy_timer_evt); ··· 41 41 clockevents_register_device(evt); 42 42 } 43 43 44 - static int __cpuinit dummy_timer_cpu_notify(struct notifier_block *self, 44 + static int dummy_timer_cpu_notify(struct notifier_block *self, 45 45 unsigned long action, void *hcpu) 46 46 { 47 47 if ((action & ~CPU_TASKS_FROZEN) == CPU_STARTING) ··· 50 50 return NOTIFY_OK; 51 51 } 52 52 53 - static struct notifier_block dummy_timer_cpu_nb __cpuinitdata = { 53 + static struct notifier_block dummy_timer_cpu_nb = { 54 54 .notifier_call = dummy_timer_cpu_notify, 55 55 }; 56 56
+2 -2
drivers/clocksource/exynos_mct.c
··· 400 400 return IRQ_HANDLED; 401 401 } 402 402 403 - static int __cpuinit exynos4_local_timer_setup(struct clock_event_device *evt) 403 + static int exynos4_local_timer_setup(struct clock_event_device *evt) 404 404 { 405 405 struct mct_clock_event_device *mevt; 406 406 unsigned int cpu = smp_processor_id(); ··· 448 448 disable_percpu_irq(mct_irqs[MCT_L0_IRQ]); 449 449 } 450 450 451 - static struct local_timer_ops exynos4_mct_tick_ops __cpuinitdata = { 451 + static struct local_timer_ops exynos4_mct_tick_ops = { 452 452 .setup = exynos4_local_timer_setup, 453 453 .stop = exynos4_local_timer_stop, 454 454 };
+3 -3
drivers/clocksource/metag_generic.c
··· 109 109 return ticks << HARDWARE_TO_NS_SHIFT; 110 110 } 111 111 112 - static void __cpuinit arch_timer_setup(unsigned int cpu) 112 + static void arch_timer_setup(unsigned int cpu) 113 113 { 114 114 unsigned int txdivtime; 115 115 struct clock_event_device *clk = &per_cpu(local_clockevent, cpu); ··· 154 154 } 155 155 } 156 156 157 - static int __cpuinit arch_timer_cpu_notify(struct notifier_block *self, 157 + static int arch_timer_cpu_notify(struct notifier_block *self, 158 158 unsigned long action, void *hcpu) 159 159 { 160 160 int cpu = (long)hcpu; ··· 169 169 return NOTIFY_OK; 170 170 } 171 171 172 - static struct notifier_block __cpuinitdata arch_timer_cpu_nb = { 172 + static struct notifier_block arch_timer_cpu_nb = { 173 173 .notifier_call = arch_timer_cpu_notify, 174 174 }; 175 175
+2 -2
drivers/clocksource/time-armada-370-xp.c
··· 167 167 /* 168 168 * Setup the local clock events for a CPU. 169 169 */ 170 - static int __cpuinit armada_370_xp_timer_setup(struct clock_event_device *evt) 170 + static int armada_370_xp_timer_setup(struct clock_event_device *evt) 171 171 { 172 172 u32 u; 173 173 int cpu = smp_processor_id(); ··· 205 205 disable_percpu_irq(evt->irq); 206 206 } 207 207 208 - static struct local_timer_ops armada_370_xp_local_timer_ops __cpuinitdata = { 208 + static struct local_timer_ops armada_370_xp_local_timer_ops = { 209 209 .setup = armada_370_xp_timer_setup, 210 210 .stop = armada_370_xp_timer_stop, 211 211 };
+2 -2
drivers/clocksource/timer-marco.c
··· 184 184 .handler = sirfsoc_timer_interrupt, 185 185 }; 186 186 187 - static int __cpuinit sirfsoc_local_timer_setup(struct clock_event_device *ce) 187 + static int sirfsoc_local_timer_setup(struct clock_event_device *ce) 188 188 { 189 189 /* Use existing clock_event for cpu 0 */ 190 190 if (!smp_processor_id()) ··· 216 216 remove_irq(sirfsoc_timer1_irq.irq, &sirfsoc_timer1_irq); 217 217 } 218 218 219 - static struct local_timer_ops sirfsoc_local_timer_ops __cpuinitdata = { 219 + static struct local_timer_ops sirfsoc_local_timer_ops = { 220 220 .setup = sirfsoc_local_timer_setup, 221 221 .stop = sirfsoc_local_timer_stop, 222 222 };
+4 -4
drivers/irqchip/irq-gic.c
··· 414 414 writel_relaxed(1, base + GIC_DIST_CTRL); 415 415 } 416 416 417 - static void __cpuinit gic_cpu_init(struct gic_chip_data *gic) 417 + static void gic_cpu_init(struct gic_chip_data *gic) 418 418 { 419 419 void __iomem *dist_base = gic_data_dist_base(gic); 420 420 void __iomem *base = gic_data_cpu_base(gic); ··· 702 702 } 703 703 704 704 #ifdef CONFIG_SMP 705 - static int __cpuinit gic_secondary_init(struct notifier_block *nfb, 706 - unsigned long action, void *hcpu) 705 + static int gic_secondary_init(struct notifier_block *nfb, unsigned long action, 706 + void *hcpu) 707 707 { 708 708 if (action == CPU_STARTING || action == CPU_STARTING_FROZEN) 709 709 gic_cpu_init(&gic_data[0]); ··· 714 714 * Notifier for enabling the GIC CPU interface. Set an arbitrarily high 715 715 * priority because the GIC needs to be up before the ARM generic timers. 716 716 */ 717 - static struct notifier_block __cpuinitdata gic_cpu_notifier = { 717 + static struct notifier_block gic_cpu_notifier = { 718 718 .notifier_call = gic_secondary_init, 719 719 .priority = 100, 720 720 };