Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eba682a5 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Rafael J. Wysocki
Browse files

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: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Acked-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 4a10c2ac
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -123,7 +123,7 @@ static struct cpuidle_state *cpuidle_state_table;
 * which is also the index into the MWAIT hint array.
 * Thus C0 is a dummy.
 */
static struct cpuidle_state nehalem_cstates[CPUIDLE_STATE_MAX] = {
static struct cpuidle_state nehalem_cstates[] = {
	{
		.name = "C1-NHM",
		.desc = "MWAIT 0x00",
@@ -156,7 +156,7 @@ static struct cpuidle_state nehalem_cstates[CPUIDLE_STATE_MAX] = {
		.enter = NULL }
};

static struct cpuidle_state snb_cstates[CPUIDLE_STATE_MAX] = {
static struct cpuidle_state snb_cstates[] = {
	{
		.name = "C1-SNB",
		.desc = "MWAIT 0x00",
@@ -196,7 +196,7 @@ static struct cpuidle_state snb_cstates[CPUIDLE_STATE_MAX] = {
		.enter = NULL }
};

static struct cpuidle_state ivb_cstates[CPUIDLE_STATE_MAX] = {
static struct cpuidle_state ivb_cstates[] = {
	{
		.name = "C1-IVB",
		.desc = "MWAIT 0x00",
@@ -236,7 +236,7 @@ static struct cpuidle_state ivb_cstates[CPUIDLE_STATE_MAX] = {
		.enter = NULL }
};

static struct cpuidle_state hsw_cstates[CPUIDLE_STATE_MAX] = {
static struct cpuidle_state hsw_cstates[] = {
	{
		.name = "C1-HSW",
		.desc = "MWAIT 0x00",
@@ -297,7 +297,7 @@ static struct cpuidle_state hsw_cstates[CPUIDLE_STATE_MAX] = {
		.enter = NULL }
};

static struct cpuidle_state atom_cstates[CPUIDLE_STATE_MAX] = {
static struct cpuidle_state atom_cstates[] = {
	{
		.name = "C1E-ATM",
		.desc = "MWAIT 0x00",
@@ -628,7 +628,7 @@ static int intel_idle_cpu_init(int cpu)
		int num_substates, mwait_hint, mwait_cstate, mwait_substate;

		if (cpuidle_state_table[cstate].enter == NULL)
			continue;
			break;

		if (cstate + 1 > max_cstate) {
			printk(PREFIX "max_cstate %d reached\n", max_cstate);