Skip to content

Commit 4603f53

Browse files
author
Paul Gortmaker
committed
sh: delete __cpuinit usage from all sh 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 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) are flagged as __cpuinit -- so if we remove the __cpuinit from arch specific callers, we will also get section mismatch warnings. As an intermediate step, we intend to turn the linux/init.h cpuinit 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 arch/sh uses of the __cpuinit macros from all C files. Currently sh does not have any __CPUINIT used in assembly files. [1] https://lkml.org/lkml/2013/5/20/589 Cc: Paul Mundt <lethal@linux-sh.org> Cc: linux-sh@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
1 parent e2741f1 commit 4603f53

14 files changed

Lines changed: 28 additions & 28 deletions

File tree

‎arch/sh/kernel/cpu/init.c‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
* peripherals (nofpu, nodsp, and so forth).
4444
*/
4545
#define onchip_setup(x) \
46-
static int x##_disabled __cpuinitdata = !cpu_has_##x; \
46+
static int x##_disabled = !cpu_has_##x; \
4747
\
48-
static int __cpuinit x##_setup(char *opts) \
48+
static int x##_setup(char *opts) \
4949
{ \
5050
x##_disabled = 1; \
5151
return 1; \
@@ -59,7 +59,7 @@ onchip_setup(dsp);
5959
#define CPUOPM 0xff2f0000
6060
#define CPUOPM_RABD (1 << 5)
6161

62-
static void __cpuinit speculative_execution_init(void)
62+
static void speculative_execution_init(void)
6363
{
6464
/* Clear RABD */
6565
__raw_writel(__raw_readl(CPUOPM) & ~CPUOPM_RABD, CPUOPM);
@@ -78,7 +78,7 @@ static void __cpuinit speculative_execution_init(void)
7878
#define EXPMASK_BRDSSLP (1 << 1)
7979
#define EXPMASK_MMCAW (1 << 4)
8080

81-
static void __cpuinit expmask_init(void)
81+
static void expmask_init(void)
8282
{
8383
unsigned long expmask = __raw_readl(EXPMASK);
8484

@@ -217,7 +217,7 @@ static void detect_cache_shape(void)
217217
l2_cache_shape = -1; /* No S-cache */
218218
}
219219

220-
static void __cpuinit fpu_init(void)
220+
static void fpu_init(void)
221221
{
222222
/* Disable the FPU */
223223
if (fpu_disabled && (current_cpu_data.flags & CPU_HAS_FPU)) {
@@ -230,7 +230,7 @@ static void __cpuinit fpu_init(void)
230230
}
231231

232232
#ifdef CONFIG_SH_DSP
233-
static void __cpuinit release_dsp(void)
233+
static void release_dsp(void)
234234
{
235235
unsigned long sr;
236236

@@ -244,7 +244,7 @@ static void __cpuinit release_dsp(void)
244244
);
245245
}
246246

247-
static void __cpuinit dsp_init(void)
247+
static void dsp_init(void)
248248
{
249249
unsigned long sr;
250250

@@ -276,7 +276,7 @@ static void __cpuinit dsp_init(void)
276276
release_dsp();
277277
}
278278
#else
279-
static inline void __cpuinit dsp_init(void) { }
279+
static inline void dsp_init(void) { }
280280
#endif /* CONFIG_SH_DSP */
281281

282282
/**
@@ -295,7 +295,7 @@ static inline void __cpuinit dsp_init(void) { }
295295
* Each processor family is still responsible for doing its own probing
296296
* and cache configuration in cpu_probe().
297297
*/
298-
asmlinkage void __cpuinit cpu_init(void)
298+
asmlinkage void cpu_init(void)
299299
{
300300
current_thread_info()->cpu = hard_smp_processor_id();
301301

‎arch/sh/kernel/cpu/sh2/probe.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <asm/processor.h>
1414
#include <asm/cache.h>
1515

16-
void __cpuinit cpu_probe(void)
16+
void cpu_probe(void)
1717
{
1818
#if defined(CONFIG_CPU_SUBTYPE_SH7619)
1919
boot_cpu_data.type = CPU_SH7619;

‎arch/sh/kernel/cpu/sh2a/probe.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <asm/processor.h>
1414
#include <asm/cache.h>
1515

16-
void __cpuinit cpu_probe(void)
16+
void cpu_probe(void)
1717
{
1818
boot_cpu_data.family = CPU_FAMILY_SH2A;
1919

‎arch/sh/kernel/cpu/sh3/probe.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <asm/cache.h>
1717
#include <asm/io.h>
1818

19-
void __cpuinit cpu_probe(void)
19+
void cpu_probe(void)
2020
{
2121
unsigned long addr0, addr1, data0, data1, data2, data3;
2222

‎arch/sh/kernel/cpu/sh4/probe.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <asm/processor.h>
1616
#include <asm/cache.h>
1717

18-
void __cpuinit cpu_probe(void)
18+
void cpu_probe(void)
1919
{
2020
unsigned long pvr, prr, cvr;
2121
unsigned long size;

‎arch/sh/kernel/cpu/sh4a/smp-shx3.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ static void shx3_update_boot_vector(unsigned int cpu)
124124
__raw_writel(STBCR_RESET, STBCR_REG(cpu));
125125
}
126126

127-
static int __cpuinit
127+
static int
128128
shx3_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
129129
{
130130
unsigned int cpu = (unsigned int)hcpu;
@@ -143,11 +143,11 @@ shx3_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
143143
return NOTIFY_OK;
144144
}
145145

146-
static struct notifier_block __cpuinitdata shx3_cpu_notifier = {
146+
static struct notifier_block shx3_cpu_notifier = {
147147
.notifier_call = shx3_cpu_callback,
148148
};
149149

150-
static int __cpuinit register_shx3_cpu_notifier(void)
150+
static int register_shx3_cpu_notifier(void)
151151
{
152152
register_hotcpu_notifier(&shx3_cpu_notifier);
153153
return 0;

‎arch/sh/kernel/cpu/sh5/probe.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include <asm/cache.h>
1818
#include <asm/tlb.h>
1919

20-
void __cpuinit cpu_probe(void)
20+
void cpu_probe(void)
2121
{
2222
unsigned long long cir;
2323

‎arch/sh/kernel/perf_event.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ static void sh_pmu_setup(int cpu)
367367
memset(cpuhw, 0, sizeof(struct cpu_hw_events));
368368
}
369369

370-
static int __cpuinit
370+
static int
371371
sh_pmu_notifier(struct notifier_block *self, unsigned long action, void *hcpu)
372372
{
373373
unsigned int cpu = (long)hcpu;
@@ -384,7 +384,7 @@ sh_pmu_notifier(struct notifier_block *self, unsigned long action, void *hcpu)
384384
return NOTIFY_OK;
385385
}
386386

387-
int __cpuinit register_sh_pmu(struct sh_pmu *_pmu)
387+
int register_sh_pmu(struct sh_pmu *_pmu)
388388
{
389389
if (sh_pmu)
390390
return -EBUSY;

‎arch/sh/kernel/process.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void arch_task_cache_init(void)
6565
# define HAVE_SOFTFP 0
6666
#endif
6767

68-
void __cpuinit init_thread_xstate(void)
68+
void init_thread_xstate(void)
6969
{
7070
if (boot_cpu_data.flags & CPU_HAS_FPU)
7171
xstate_size = sizeof(struct sh_fpu_hard_struct);

‎arch/sh/kernel/setup.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ void __init check_for_initrd(void)
172172
#endif
173173
}
174174

175-
void __cpuinit calibrate_delay(void)
175+
void calibrate_delay(void)
176176
{
177177
struct clk *clk = clk_get(NULL, "cpu_clk");
178178

0 commit comments

Comments
 (0)