diff options
| author | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | 2013-08-30 06:25:10 -0400 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-09-23 19:42:58 -0400 |
| commit | eba682a5aeb6c9bf08a9751f8d3ecafe043d8f88 (patch) | |
| tree | 5894d674aa5bfb39a771374df957f4118071b914 /drivers | |
| parent | 4a10c2ac2f368583138b774ca41fac4207911983 (diff) | |
intel_idle: shrink states tables
There is no reason to define CPUIDLE_STATE_MAX (currently 10) entries
in states tables if the driver always stops iterating over table when
it encounters first .enter == NULL entry.
$ size drivers/idle/intel_idle.o.*
text data bss dec hex filename
2886 5440 32 8358 20a6 drivers/idle/intel_idle.o.before
2886 3752 32 6670 1a0e drivers/idle/intel_idle.o.after
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/idle/intel_idle.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c index fa6964d8681a..9c97fbb426df 100644 --- a/drivers/idle/intel_idle.c +++ b/drivers/idle/intel_idle.c | |||
| @@ -123,7 +123,7 @@ static struct cpuidle_state *cpuidle_state_table; | |||
| 123 | * which is also the index into the MWAIT hint array. | 123 | * which is also the index into the MWAIT hint array. |
| 124 | * Thus C0 is a dummy. | 124 | * Thus C0 is a dummy. |
| 125 | */ | 125 | */ |
| 126 | static struct cpuidle_state nehalem_cstates[CPUIDLE_STATE_MAX] = { | 126 | static struct cpuidle_state nehalem_cstates[] = { |
| 127 | { | 127 | { |
| 128 | .name = "C1-NHM", | 128 | .name = "C1-NHM", |
| 129 | .desc = "MWAIT 0x00", | 129 | .desc = "MWAIT 0x00", |
| @@ -156,7 +156,7 @@ static struct cpuidle_state nehalem_cstates[CPUIDLE_STATE_MAX] = { | |||
| 156 | .enter = NULL } | 156 | .enter = NULL } |
| 157 | }; | 157 | }; |
| 158 | 158 | ||
| 159 | static struct cpuidle_state snb_cstates[CPUIDLE_STATE_MAX] = { | 159 | static struct cpuidle_state snb_cstates[] = { |
| 160 | { | 160 | { |
| 161 | .name = "C1-SNB", | 161 | .name = "C1-SNB", |
| 162 | .desc = "MWAIT 0x00", | 162 | .desc = "MWAIT 0x00", |
| @@ -196,7 +196,7 @@ static struct cpuidle_state snb_cstates[CPUIDLE_STATE_MAX] = { | |||
| 196 | .enter = NULL } | 196 | .enter = NULL } |
| 197 | }; | 197 | }; |
| 198 | 198 | ||
| 199 | static struct cpuidle_state ivb_cstates[CPUIDLE_STATE_MAX] = { | 199 | static struct cpuidle_state ivb_cstates[] = { |
| 200 | { | 200 | { |
| 201 | .name = "C1-IVB", | 201 | .name = "C1-IVB", |
| 202 | .desc = "MWAIT 0x00", | 202 | .desc = "MWAIT 0x00", |
| @@ -236,7 +236,7 @@ static struct cpuidle_state ivb_cstates[CPUIDLE_STATE_MAX] = { | |||
| 236 | .enter = NULL } | 236 | .enter = NULL } |
| 237 | }; | 237 | }; |
| 238 | 238 | ||
| 239 | static struct cpuidle_state hsw_cstates[CPUIDLE_STATE_MAX] = { | 239 | static struct cpuidle_state hsw_cstates[] = { |
| 240 | { | 240 | { |
| 241 | .name = "C1-HSW", | 241 | .name = "C1-HSW", |
| 242 | .desc = "MWAIT 0x00", | 242 | .desc = "MWAIT 0x00", |
| @@ -297,7 +297,7 @@ static struct cpuidle_state hsw_cstates[CPUIDLE_STATE_MAX] = { | |||
| 297 | .enter = NULL } | 297 | .enter = NULL } |
| 298 | }; | 298 | }; |
| 299 | 299 | ||
| 300 | static struct cpuidle_state atom_cstates[CPUIDLE_STATE_MAX] = { | 300 | static struct cpuidle_state atom_cstates[] = { |
| 301 | { | 301 | { |
| 302 | .name = "C1E-ATM", | 302 | .name = "C1E-ATM", |
| 303 | .desc = "MWAIT 0x00", | 303 | .desc = "MWAIT 0x00", |
| @@ -628,7 +628,7 @@ static int intel_idle_cpu_init(int cpu) | |||
| 628 | int num_substates, mwait_hint, mwait_cstate, mwait_substate; | 628 | int num_substates, mwait_hint, mwait_cstate, mwait_substate; |
| 629 | 629 | ||
| 630 | if (cpuidle_state_table[cstate].enter == NULL) | 630 | if (cpuidle_state_table[cstate].enter == NULL) |
| 631 | continue; | 631 | break; |
| 632 | 632 | ||
| 633 | if (cstate + 1 > max_cstate) { | 633 | if (cstate + 1 > max_cstate) { |
| 634 | printk(PREFIX "max_cstate %d reached\n", max_cstate); | 634 | printk(PREFIX "max_cstate %d reached\n", max_cstate); |
