Commit 2760984f authored by Paul Gortmaker's avatar Paul Gortmaker

cpufreq: delete __cpuinit usage from all cpufreq 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 5e427ec2 ("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/cpufreq uses of the __cpuinit macros
from all C files.

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

[v2: leave 2nd lines of args misaligned as requested by Viresh]
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: cpufreq@vger.kernel.org
Cc: linux-pm@vger.kernel.org
Acked-by: default avatarDirk Brandewie <dirk.j.brandewie@intel.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
parent 8c37bb3a
...@@ -1932,7 +1932,7 @@ int cpufreq_update_policy(unsigned int cpu) ...@@ -1932,7 +1932,7 @@ int cpufreq_update_policy(unsigned int cpu)
} }
EXPORT_SYMBOL(cpufreq_update_policy); EXPORT_SYMBOL(cpufreq_update_policy);
static int __cpuinit cpufreq_cpu_callback(struct notifier_block *nfb, static int cpufreq_cpu_callback(struct notifier_block *nfb,
unsigned long action, void *hcpu) unsigned long action, void *hcpu)
{ {
unsigned int cpu = (unsigned long)hcpu; unsigned int cpu = (unsigned long)hcpu;
......
...@@ -341,7 +341,7 @@ static int cpufreq_stat_notifier_trans(struct notifier_block *nb, ...@@ -341,7 +341,7 @@ static int cpufreq_stat_notifier_trans(struct notifier_block *nb,
return 0; return 0;
} }
static int __cpuinit cpufreq_stat_cpu_callback(struct notifier_block *nfb, static int cpufreq_stat_cpu_callback(struct notifier_block *nfb,
unsigned long action, unsigned long action,
void *hcpu) void *hcpu)
{ {
......
...@@ -82,7 +82,7 @@ static unsigned int dbx500_cpufreq_getspeed(unsigned int cpu) ...@@ -82,7 +82,7 @@ static unsigned int dbx500_cpufreq_getspeed(unsigned int cpu)
return freq_table[i].frequency; return freq_table[i].frequency;
} }
static int __cpuinit dbx500_cpufreq_init(struct cpufreq_policy *policy) static int dbx500_cpufreq_init(struct cpufreq_policy *policy)
{ {
int res; int res;
......
...@@ -617,7 +617,7 @@ static int intel_pstate_verify_policy(struct cpufreq_policy *policy) ...@@ -617,7 +617,7 @@ static int intel_pstate_verify_policy(struct cpufreq_policy *policy)
return 0; return 0;
} }
static int __cpuinit intel_pstate_cpu_exit(struct cpufreq_policy *policy) static int intel_pstate_cpu_exit(struct cpufreq_policy *policy)
{ {
int cpu = policy->cpu; int cpu = policy->cpu;
...@@ -627,7 +627,7 @@ static int __cpuinit intel_pstate_cpu_exit(struct cpufreq_policy *policy) ...@@ -627,7 +627,7 @@ static int __cpuinit intel_pstate_cpu_exit(struct cpufreq_policy *policy)
return 0; return 0;
} }
static int __cpuinit intel_pstate_cpu_init(struct cpufreq_policy *policy) static int intel_pstate_cpu_init(struct cpufreq_policy *policy)
{ {
int rc, min_pstate, max_pstate; int rc, min_pstate, max_pstate;
struct cpudata *cpu; struct cpudata *cpu;
......
...@@ -422,7 +422,7 @@ static int guess_fsb(int mult) ...@@ -422,7 +422,7 @@ static int guess_fsb(int mult)
} }
static int __cpuinit longhaul_get_ranges(void) static int longhaul_get_ranges(void)
{ {
unsigned int i, j, k = 0; unsigned int i, j, k = 0;
unsigned int ratio; unsigned int ratio;
...@@ -526,7 +526,7 @@ static int __cpuinit longhaul_get_ranges(void) ...@@ -526,7 +526,7 @@ static int __cpuinit longhaul_get_ranges(void)
} }
static void __cpuinit longhaul_setup_voltagescaling(void) static void longhaul_setup_voltagescaling(void)
{ {
union msr_longhaul longhaul; union msr_longhaul longhaul;
struct mV_pos minvid, maxvid, vid; struct mV_pos minvid, maxvid, vid;
...@@ -780,7 +780,7 @@ static int longhaul_setup_southbridge(void) ...@@ -780,7 +780,7 @@ static int longhaul_setup_southbridge(void)
return 0; return 0;
} }
static int __cpuinit longhaul_cpu_init(struct cpufreq_policy *policy) static int longhaul_cpu_init(struct cpufreq_policy *policy)
{ {
struct cpuinfo_x86 *c = &cpu_data(0); struct cpuinfo_x86 *c = &cpu_data(0);
char *cpuname = NULL; char *cpuname = NULL;
......
...@@ -56,7 +56,7 @@ union msr_longhaul { ...@@ -56,7 +56,7 @@ union msr_longhaul {
/* /*
* VIA C3 Samuel 1 & Samuel 2 (stepping 0) * VIA C3 Samuel 1 & Samuel 2 (stepping 0)
*/ */
static const int __cpuinitconst samuel1_mults[16] = { static const int samuel1_mults[16] = {
-1, /* 0000 -> RESERVED */ -1, /* 0000 -> RESERVED */
30, /* 0001 -> 3.0x */ 30, /* 0001 -> 3.0x */
40, /* 0010 -> 4.0x */ 40, /* 0010 -> 4.0x */
...@@ -75,7 +75,7 @@ static const int __cpuinitconst samuel1_mults[16] = { ...@@ -75,7 +75,7 @@ static const int __cpuinitconst samuel1_mults[16] = {
-1, /* 1111 -> RESERVED */ -1, /* 1111 -> RESERVED */
}; };
static const int __cpuinitconst samuel1_eblcr[16] = { static const int samuel1_eblcr[16] = {
50, /* 0000 -> RESERVED */ 50, /* 0000 -> RESERVED */
30, /* 0001 -> 3.0x */ 30, /* 0001 -> 3.0x */
40, /* 0010 -> 4.0x */ 40, /* 0010 -> 4.0x */
...@@ -97,7 +97,7 @@ static const int __cpuinitconst samuel1_eblcr[16] = { ...@@ -97,7 +97,7 @@ static const int __cpuinitconst samuel1_eblcr[16] = {
/* /*
* VIA C3 Samuel2 Stepping 1->15 * VIA C3 Samuel2 Stepping 1->15
*/ */
static const int __cpuinitconst samuel2_eblcr[16] = { static const int samuel2_eblcr[16] = {
50, /* 0000 -> 5.0x */ 50, /* 0000 -> 5.0x */
30, /* 0001 -> 3.0x */ 30, /* 0001 -> 3.0x */
40, /* 0010 -> 4.0x */ 40, /* 0010 -> 4.0x */
...@@ -119,7 +119,7 @@ static const int __cpuinitconst samuel2_eblcr[16] = { ...@@ -119,7 +119,7 @@ static const int __cpuinitconst samuel2_eblcr[16] = {
/* /*
* VIA C3 Ezra * VIA C3 Ezra
*/ */
static const int __cpuinitconst ezra_mults[16] = { static const int ezra_mults[16] = {
100, /* 0000 -> 10.0x */ 100, /* 0000 -> 10.0x */
30, /* 0001 -> 3.0x */ 30, /* 0001 -> 3.0x */
40, /* 0010 -> 4.0x */ 40, /* 0010 -> 4.0x */
...@@ -138,7 +138,7 @@ static const int __cpuinitconst ezra_mults[16] = { ...@@ -138,7 +138,7 @@ static const int __cpuinitconst ezra_mults[16] = {
120, /* 1111 -> 12.0x */ 120, /* 1111 -> 12.0x */
}; };
static const int __cpuinitconst ezra_eblcr[16] = { static const int ezra_eblcr[16] = {
50, /* 0000 -> 5.0x */ 50, /* 0000 -> 5.0x */
30, /* 0001 -> 3.0x */ 30, /* 0001 -> 3.0x */
40, /* 0010 -> 4.0x */ 40, /* 0010 -> 4.0x */
...@@ -160,7 +160,7 @@ static const int __cpuinitconst ezra_eblcr[16] = { ...@@ -160,7 +160,7 @@ static const int __cpuinitconst ezra_eblcr[16] = {
/* /*
* VIA C3 (Ezra-T) [C5M]. * VIA C3 (Ezra-T) [C5M].
*/ */
static const int __cpuinitconst ezrat_mults[32] = { static const int ezrat_mults[32] = {
100, /* 0000 -> 10.0x */ 100, /* 0000 -> 10.0x */
30, /* 0001 -> 3.0x */ 30, /* 0001 -> 3.0x */
40, /* 0010 -> 4.0x */ 40, /* 0010 -> 4.0x */
...@@ -196,7 +196,7 @@ static const int __cpuinitconst ezrat_mults[32] = { ...@@ -196,7 +196,7 @@ static const int __cpuinitconst ezrat_mults[32] = {
-1, /* 1111 -> RESERVED (12.0x) */ -1, /* 1111 -> RESERVED (12.0x) */
}; };
static const int __cpuinitconst ezrat_eblcr[32] = { static const int ezrat_eblcr[32] = {
50, /* 0000 -> 5.0x */ 50, /* 0000 -> 5.0x */
30, /* 0001 -> 3.0x */ 30, /* 0001 -> 3.0x */
40, /* 0010 -> 4.0x */ 40, /* 0010 -> 4.0x */
...@@ -235,7 +235,7 @@ static const int __cpuinitconst ezrat_eblcr[32] = { ...@@ -235,7 +235,7 @@ static const int __cpuinitconst ezrat_eblcr[32] = {
/* /*
* VIA C3 Nehemiah */ * VIA C3 Nehemiah */
static const int __cpuinitconst nehemiah_mults[32] = { static const int nehemiah_mults[32] = {
100, /* 0000 -> 10.0x */ 100, /* 0000 -> 10.0x */
-1, /* 0001 -> 16.0x */ -1, /* 0001 -> 16.0x */
40, /* 0010 -> 4.0x */ 40, /* 0010 -> 4.0x */
...@@ -270,7 +270,7 @@ static const int __cpuinitconst nehemiah_mults[32] = { ...@@ -270,7 +270,7 @@ static const int __cpuinitconst nehemiah_mults[32] = {
-1, /* 1111 -> 12.0x */ -1, /* 1111 -> 12.0x */
}; };
static const int __cpuinitconst nehemiah_eblcr[32] = { static const int nehemiah_eblcr[32] = {
50, /* 0000 -> 5.0x */ 50, /* 0000 -> 5.0x */
160, /* 0001 -> 16.0x */ 160, /* 0001 -> 16.0x */
40, /* 0010 -> 4.0x */ 40, /* 0010 -> 4.0x */
...@@ -315,7 +315,7 @@ struct mV_pos { ...@@ -315,7 +315,7 @@ struct mV_pos {
unsigned short pos; unsigned short pos;
}; };
static const struct mV_pos __cpuinitconst vrm85_mV[32] = { static const struct mV_pos vrm85_mV[32] = {
{1250, 8}, {1200, 6}, {1150, 4}, {1100, 2}, {1250, 8}, {1200, 6}, {1150, 4}, {1100, 2},
{1050, 0}, {1800, 30}, {1750, 28}, {1700, 26}, {1050, 0}, {1800, 30}, {1750, 28}, {1700, 26},
{1650, 24}, {1600, 22}, {1550, 20}, {1500, 18}, {1650, 24}, {1600, 22}, {1550, 20}, {1500, 18},
...@@ -326,14 +326,14 @@ static const struct mV_pos __cpuinitconst vrm85_mV[32] = { ...@@ -326,14 +326,14 @@ static const struct mV_pos __cpuinitconst vrm85_mV[32] = {
{1475, 17}, {1425, 15}, {1375, 13}, {1325, 11} {1475, 17}, {1425, 15}, {1375, 13}, {1325, 11}
}; };
static const unsigned char __cpuinitconst mV_vrm85[32] = { static const unsigned char mV_vrm85[32] = {
0x04, 0x14, 0x03, 0x13, 0x02, 0x12, 0x01, 0x11, 0x04, 0x14, 0x03, 0x13, 0x02, 0x12, 0x01, 0x11,
0x00, 0x10, 0x0f, 0x1f, 0x0e, 0x1e, 0x0d, 0x1d, 0x00, 0x10, 0x0f, 0x1f, 0x0e, 0x1e, 0x0d, 0x1d,
0x0c, 0x1c, 0x0b, 0x1b, 0x0a, 0x1a, 0x09, 0x19, 0x0c, 0x1c, 0x0b, 0x1b, 0x0a, 0x1a, 0x09, 0x19,
0x08, 0x18, 0x07, 0x17, 0x06, 0x16, 0x05, 0x15 0x08, 0x18, 0x07, 0x17, 0x06, 0x16, 0x05, 0x15
}; };
static const struct mV_pos __cpuinitconst mobilevrm_mV[32] = { static const struct mV_pos mobilevrm_mV[32] = {
{1750, 31}, {1700, 30}, {1650, 29}, {1600, 28}, {1750, 31}, {1700, 30}, {1650, 29}, {1600, 28},
{1550, 27}, {1500, 26}, {1450, 25}, {1400, 24}, {1550, 27}, {1500, 26}, {1450, 25}, {1400, 24},
{1350, 23}, {1300, 22}, {1250, 21}, {1200, 20}, {1350, 23}, {1300, 22}, {1250, 21}, {1200, 20},
...@@ -344,7 +344,7 @@ static const struct mV_pos __cpuinitconst mobilevrm_mV[32] = { ...@@ -344,7 +344,7 @@ static const struct mV_pos __cpuinitconst mobilevrm_mV[32] = {
{675, 3}, {650, 2}, {625, 1}, {600, 0} {675, 3}, {650, 2}, {625, 1}, {600, 0}
}; };
static const unsigned char __cpuinitconst mV_mobilevrm[32] = { static const unsigned char mV_mobilevrm[32] = {
0x1f, 0x1e, 0x1d, 0x1c, 0x1b, 0x1a, 0x19, 0x18, 0x1f, 0x1e, 0x1d, 0x1c, 0x1b, 0x1a, 0x19, 0x18,
0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10, 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10,
0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08,
......
...@@ -33,7 +33,7 @@ static unsigned int longrun_low_freq, longrun_high_freq; ...@@ -33,7 +33,7 @@ static unsigned int longrun_low_freq, longrun_high_freq;
* Reads the current LongRun policy by access to MSR_TMTA_LONGRUN_FLAGS * Reads the current LongRun policy by access to MSR_TMTA_LONGRUN_FLAGS
* and MSR_TMTA_LONGRUN_CTRL * and MSR_TMTA_LONGRUN_CTRL
*/ */
static void __cpuinit longrun_get_policy(struct cpufreq_policy *policy) static void longrun_get_policy(struct cpufreq_policy *policy)
{ {
u32 msr_lo, msr_hi; u32 msr_lo, msr_hi;
...@@ -163,7 +163,7 @@ static unsigned int longrun_get(unsigned int cpu) ...@@ -163,7 +163,7 @@ static unsigned int longrun_get(unsigned int cpu)
* TMTA rules: * TMTA rules:
* performance_pctg = (target_freq - low_freq)/(high_freq - low_freq) * performance_pctg = (target_freq - low_freq)/(high_freq - low_freq)
*/ */
static int __cpuinit longrun_determine_freqs(unsigned int *low_freq, static int longrun_determine_freqs(unsigned int *low_freq,
unsigned int *high_freq) unsigned int *high_freq)
{ {
u32 msr_lo, msr_hi; u32 msr_lo, msr_hi;
...@@ -256,7 +256,7 @@ static int __cpuinit longrun_determine_freqs(unsigned int *low_freq, ...@@ -256,7 +256,7 @@ static int __cpuinit longrun_determine_freqs(unsigned int *low_freq,
} }
static int __cpuinit longrun_cpu_init(struct cpufreq_policy *policy) static int longrun_cpu_init(struct cpufreq_policy *policy)
{ {
int result = 0; int result = 0;
......
...@@ -165,7 +165,7 @@ static inline void freq_table_free(void) ...@@ -165,7 +165,7 @@ static inline void freq_table_free(void)
opp_free_cpufreq_table(mpu_dev, &freq_table); opp_free_cpufreq_table(mpu_dev, &freq_table);
} }
static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy) static int omap_cpu_init(struct cpufreq_policy *policy)
{ {
int result = 0; int result = 0;
......
...@@ -563,7 +563,7 @@ static int powernow_verify(struct cpufreq_policy *policy) ...@@ -563,7 +563,7 @@ static int powernow_verify(struct cpufreq_policy *policy)
* We will then get the same kind of behaviour already tested under * We will then get the same kind of behaviour already tested under
* the "well-known" other OS. * the "well-known" other OS.
*/ */
static int __cpuinit fixup_sgtc(void) static int fixup_sgtc(void)
{ {
unsigned int sgtc; unsigned int sgtc;
unsigned int m; unsigned int m;
...@@ -597,7 +597,7 @@ static unsigned int powernow_get(unsigned int cpu) ...@@ -597,7 +597,7 @@ static unsigned int powernow_get(unsigned int cpu)
} }
static int __cpuinit acer_cpufreq_pst(const struct dmi_system_id *d) static int acer_cpufreq_pst(const struct dmi_system_id *d)
{ {
printk(KERN_WARNING PFX printk(KERN_WARNING PFX
"%s laptop with broken PST tables in BIOS detected.\n", "%s laptop with broken PST tables in BIOS detected.\n",
...@@ -615,7 +615,7 @@ static int __cpuinit acer_cpufreq_pst(const struct dmi_system_id *d) ...@@ -615,7 +615,7 @@ static int __cpuinit acer_cpufreq_pst(const struct dmi_system_id *d)
* A BIOS update is all that can save them. * A BIOS update is all that can save them.
* Mention this, and disable cpufreq. * Mention this, and disable cpufreq.
*/ */
static struct dmi_system_id __cpuinitdata powernow_dmi_table[] = { static struct dmi_system_id powernow_dmi_table[] = {
{ {
.callback = acer_cpufreq_pst, .callback = acer_cpufreq_pst,
.ident = "Acer Aspire", .ident = "Acer Aspire",
...@@ -627,7 +627,7 @@ static struct dmi_system_id __cpuinitdata powernow_dmi_table[] = { ...@@ -627,7 +627,7 @@ static struct dmi_system_id __cpuinitdata powernow_dmi_table[] = {
{ } { }
}; };
static int __cpuinit powernow_cpu_init(struct cpufreq_policy *policy) static int powernow_cpu_init(struct cpufreq_policy *policy)
{ {
union msr_fidvidstatus fidvidstatus; union msr_fidvidstatus fidvidstatus;
int result; int result;
......
...@@ -1069,7 +1069,7 @@ struct init_on_cpu { ...@@ -1069,7 +1069,7 @@ struct init_on_cpu {
int rc; int rc;
}; };
static void __cpuinit powernowk8_cpu_init_on_cpu(void *_init_on_cpu) static void powernowk8_cpu_init_on_cpu(void *_init_on_cpu)
{ {
struct init_on_cpu *init_on_cpu = _init_on_cpu; struct init_on_cpu *init_on_cpu = _init_on_cpu;
...@@ -1096,7 +1096,7 @@ static const char missing_pss_msg[] = ...@@ -1096,7 +1096,7 @@ static const char missing_pss_msg[] =
FW_BUG PFX "If that doesn't help, try upgrading your BIOS.\n"; FW_BUG PFX "If that doesn't help, try upgrading your BIOS.\n";
/* per CPU init entry point to the driver */ /* per CPU init entry point to the driver */
static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) static int powernowk8_cpu_init(struct cpufreq_policy *pol)
{ {
struct powernow_k8_data *data; struct powernow_k8_data *data;
struct init_on_cpu init_on_cpu; struct init_on_cpu init_on_cpu;
...@@ -1263,7 +1263,7 @@ static void __request_acpi_cpufreq(void) ...@@ -1263,7 +1263,7 @@ static void __request_acpi_cpufreq(void)
} }
/* driver entry point for init */ /* driver entry point for init */
static int __cpuinit powernowk8_init(void) static int powernowk8_init(void)
{ {
unsigned int i, supported_cpus = 0; unsigned int i, supported_cpus = 0;
int ret; int ret;
......
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