Commit 137ecc77 authored by Len Brown's avatar Len Brown

intel_idle: remove use and definition of MWAIT_MAX_NUM_CSTATES

Cosmetic only.

Replace use of MWAIT_MAX_NUM_CSTATES with CPUIDLE_STATE_MAX.
They are both 8, so this patch has no functional change.

The reason to change is that intel_idle will soon be able
to export more than the 8 "major" states supported by MWAIT.
When we hit that limit, it is important to know
where the limit comes from.
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 67920418
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#define MWAIT_SUBSTATE_MASK 0xf #define MWAIT_SUBSTATE_MASK 0xf
#define MWAIT_CSTATE_MASK 0xf #define MWAIT_CSTATE_MASK 0xf
#define MWAIT_SUBSTATE_SIZE 4 #define MWAIT_SUBSTATE_SIZE 4
#define MWAIT_MAX_NUM_CSTATES 8
#define CPUID_MWAIT_LEAF 5 #define CPUID_MWAIT_LEAF 5
#define CPUID5_ECX_EXTENSIONS_SUPPORTED 0x1 #define CPUID5_ECX_EXTENSIONS_SUPPORTED 0x1
......
...@@ -74,7 +74,7 @@ static struct cpuidle_driver intel_idle_driver = { ...@@ -74,7 +74,7 @@ static struct cpuidle_driver intel_idle_driver = {
.en_core_tk_irqen = 1, .en_core_tk_irqen = 1,
}; };
/* intel_idle.max_cstate=0 disables driver */ /* intel_idle.max_cstate=0 disables driver */
static int max_cstate = MWAIT_MAX_NUM_CSTATES - 1; static int max_cstate = CPUIDLE_STATE_MAX - 1;
static unsigned int mwait_substates; static unsigned int mwait_substates;
...@@ -123,7 +123,7 @@ static struct cpuidle_state *cpuidle_state_table; ...@@ -123,7 +123,7 @@ static struct cpuidle_state *cpuidle_state_table;
* which is also the index into the MWAIT hint array. * which is also the index into the MWAIT hint array.
* Thus C0 is a dummy. * Thus C0 is a dummy.
*/ */
static struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = { static struct cpuidle_state nehalem_cstates[CPUIDLE_STATE_MAX] = {
{ /* MWAIT C0 */ }, { /* MWAIT C0 */ },
{ /* MWAIT C1 */ { /* MWAIT C1 */
.name = "C1-NHM", .name = "C1-NHM",
...@@ -148,7 +148,7 @@ static struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = { ...@@ -148,7 +148,7 @@ static struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = {
.enter = &intel_idle }, .enter = &intel_idle },
}; };
static struct cpuidle_state snb_cstates[MWAIT_MAX_NUM_CSTATES] = { static struct cpuidle_state snb_cstates[CPUIDLE_STATE_MAX] = {
{ /* MWAIT C0 */ }, { /* MWAIT C0 */ },
{ /* MWAIT C1 */ { /* MWAIT C1 */
.name = "C1-SNB", .name = "C1-SNB",
...@@ -180,7 +180,7 @@ static struct cpuidle_state snb_cstates[MWAIT_MAX_NUM_CSTATES] = { ...@@ -180,7 +180,7 @@ static struct cpuidle_state snb_cstates[MWAIT_MAX_NUM_CSTATES] = {
.enter = &intel_idle }, .enter = &intel_idle },
}; };
static struct cpuidle_state ivb_cstates[MWAIT_MAX_NUM_CSTATES] = { static struct cpuidle_state ivb_cstates[CPUIDLE_STATE_MAX] = {
{ /* MWAIT C0 */ }, { /* MWAIT C0 */ },
{ /* MWAIT C1 */ { /* MWAIT C1 */
.name = "C1-IVB", .name = "C1-IVB",
...@@ -212,7 +212,7 @@ static struct cpuidle_state ivb_cstates[MWAIT_MAX_NUM_CSTATES] = { ...@@ -212,7 +212,7 @@ static struct cpuidle_state ivb_cstates[MWAIT_MAX_NUM_CSTATES] = {
.enter = &intel_idle }, .enter = &intel_idle },
}; };
static struct cpuidle_state hsw_cstates[MWAIT_MAX_NUM_CSTATES] = { static struct cpuidle_state hsw_cstates[CPUIDLE_STATE_MAX] = {
{ /* MWAIT C0 */ }, { /* MWAIT C0 */ },
{ /* MWAIT C1 */ { /* MWAIT C1 */
.name = "C1-HSW", .name = "C1-HSW",
...@@ -244,7 +244,7 @@ static struct cpuidle_state hsw_cstates[MWAIT_MAX_NUM_CSTATES] = { ...@@ -244,7 +244,7 @@ static struct cpuidle_state hsw_cstates[MWAIT_MAX_NUM_CSTATES] = {
.enter = &intel_idle }, .enter = &intel_idle },
}; };
static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = { static struct cpuidle_state atom_cstates[CPUIDLE_STATE_MAX] = {
{ /* MWAIT C0 */ }, { /* MWAIT C0 */ },
{ /* MWAIT C1 */ { /* MWAIT C1 */
.name = "C1-ATM", .name = "C1-ATM",
...@@ -503,7 +503,7 @@ static int intel_idle_cpuidle_driver_init(void) ...@@ -503,7 +503,7 @@ static int intel_idle_cpuidle_driver_init(void)
drv->state_count = 1; drv->state_count = 1;
for (cstate = 1; cstate < MWAIT_MAX_NUM_CSTATES; ++cstate) { for (cstate = 1; cstate < CPUIDLE_STATE_MAX; ++cstate) {
int num_substates; int num_substates;
if (cstate > max_cstate) { if (cstate > max_cstate) {
...@@ -560,7 +560,7 @@ static int intel_idle_cpu_init(int cpu) ...@@ -560,7 +560,7 @@ static int intel_idle_cpu_init(int cpu)
dev->state_count = 1; dev->state_count = 1;
for (cstate = 1; cstate < MWAIT_MAX_NUM_CSTATES; ++cstate) { for (cstate = 1; cstate < CPUIDLE_STATE_MAX; ++cstate) {
int num_substates; int num_substates;
if (cstate > max_cstate) { if (cstate > max_cstate) {
......
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