linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: jean.pihet@newoldbits.com (Jean Pihet)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 06/10] ARM: OMAP3: PM: cpuidle: default to C1 in next_valid_state
Date: Thu, 14 Jun 2012 17:05:57 +0200	[thread overview]
Message-ID: <1339686361-11526-7-git-send-email-j-pihet@ti.com> (raw)
In-Reply-To: <1339686361-11526-1-git-send-email-j-pihet@ti.com>

If the next state is no found in the next_valid_state function,
fallback to the default value of C1 (which is state 0).
This prevents the use of a bogus state -1 in the rest of the cpuidle
code.

Signed-off-by: Jean Pihet <j-pihet@ti.com>
---
 arch/arm/mach-omap2/cpuidle34xx.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
index 1f33b8e..9319f94 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -186,7 +186,7 @@ static int next_valid_state(struct cpuidle_device *dev,
 	u32 mpu_pm_qos_next_state = mpu_pd->wkup_lat_next_state;
 	u32 core_pm_qos_next_state = core_pd->wkup_lat_next_state;
 	int idx;
-	int next_index = -1;
+	int next_index = 0; /* C1 is the default value */
 
 	if (enable_off_mode) {
 		mpu_deepest_state = PWRDM_FUNC_PWRST_OFF;
@@ -221,12 +221,6 @@ static int next_valid_state(struct cpuidle_device *dev,
 		}
 	}
 
-	/*
-	 * C1 is always valid.
-	 * So, no need to check for 'next_index == -1' outside
-	 * this loop.
-	 */
-
 	return next_index;
 }
 
-- 
1.7.7.6

  parent reply	other threads:[~2012-06-14 15:05 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-14 15:05 [PATCH v8 00/10] PM QoS: implement the OMAP low level constraints management code Jean Pihet
2012-06-14 15:05 ` [PATCH 01/10] ARM: OMAP2+: PM QoS: control the power domains next state from the constraints Jean Pihet
2012-06-15 11:37   ` Jean Pihet
2012-07-19  9:12   ` Menon, Nishanth
2012-07-20  3:08   ` Menon, Nishanth
2012-06-14 15:05 ` [PATCH 02/10] ARM: OMAP2+: hwmod: manage the wake-up latency constraints Jean Pihet
2012-06-14 15:05 ` [PATCH 03/10] ARM: OMAP2+: PM QoS: manage the per-device latency constraints in hwmod Jean Pihet
2012-06-20 10:29   ` Rajendra Nayak
2012-06-20 11:38     ` Jean Pihet
2012-06-14 15:05 ` [PATCH 04/10] ARM: OMAP: omap_device: register to the per-device PM QoS framework Jean Pihet
2012-06-20 10:41   ` Rajendra Nayak
2012-07-19  9:21     ` Menon, Nishanth
2012-06-14 15:05 ` [PATCH 05/10] ARM: OMAP3: cpuidle: next C-state decision depends on the PM QoS MPU and CORE constraints Jean Pihet
2012-06-14 15:05 ` Jean Pihet [this message]
2012-06-14 15:05 ` [PATCH 07/10] ARM: OMAP3: update cpuidle latency and threshold figures Jean Pihet
2012-06-20 11:01   ` Rajendra Nayak
2012-06-20 11:39     ` Jean Pihet
2012-06-14 15:05 ` [PATCH 08/10] ARM: OMAP3: powerdomain data: add wake-up latency figures Jean Pihet
2012-06-14 15:06 ` [PATCH 09/10] ARM: OMAP: convert I2C driver to PM QoS for latency constraints Jean Pihet
2012-06-14 15:06 ` [PATCH 10/10] ARM: OMAP: PM: remove the latency related functions from the API Jean Pihet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1339686361-11526-7-git-send-email-j-pihet@ti.com \
    --to=jean.pihet@newoldbits.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).