From patchwork Wed Apr 4 09:42:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 7603 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 7095623E4C for ; Wed, 4 Apr 2012 09:42:34 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 39AECA1846F for ; Wed, 4 Apr 2012 09:42:34 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so109604iag.11 for ; Wed, 04 Apr 2012 02:42:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=v0G4V6+gyICZfxhQRuf0KJ28REJO64Buj16mM1vDd4o=; b=dbqLcoT6w7gyVV0tvAX7zpGdz45cf7I5B6z0GiLgaDMMdVZ8Ln1NBNb7BHBqKlj6PW awfJQL4S49LyVXSI9gf8QKbzPAdQ/IM6p2z1MhvRKFFN7oK165OReilNROXFGfIXrqr8 fjLRlVGPnIsAKhFViO9a408kp7EvcjkiRC8MaPZ72CvPGv5sEGO3g56CX8twWrHa2z6n zlwYZ6jUimXojDPK7omP060PFdzmf4hZRYNI0XAjvdHPfPmkXaNDbMFE36UHXXuQ9Znz 5wS8EV0aLUeMnT1FmGf7B0fChSzXlmOlHRgwA2ozTB95F5pgTfjjAeDMkHfhpBFzitfX Jhuw== Received: by 10.50.187.225 with SMTP id fv1mr928819igc.28.1333532554039; Wed, 04 Apr 2012 02:42:34 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.164.217 with SMTP id f25csp31237iby; Wed, 4 Apr 2012 02:42:33 -0700 (PDT) Received: by 10.180.92.71 with SMTP id ck7mr3592809wib.21.1333532551880; Wed, 04 Apr 2012 02:42:31 -0700 (PDT) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by mx.google.com with ESMTPS id w74si119385weq.59.2012.04.04.02.42.31 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 04 Apr 2012 02:42:31 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.50 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=74.125.82.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.50 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) smtp.mail=daniel.lezcano@linaro.org Received: by mail-wg0-f50.google.com with SMTP id ds12so74938wgb.31 for ; Wed, 04 Apr 2012 02:42:31 -0700 (PDT) Received: by 10.180.86.132 with SMTP id p4mr3625362wiz.15.1333532551394; Wed, 04 Apr 2012 02:42:31 -0700 (PDT) Received: from localhost.localdomain (AToulouse-159-1-7-136.w90-60.abo.wanadoo.fr. [90.60.242.136]) by mx.google.com with ESMTPS id bx13sm3462265wib.10.2012.04.04.02.42.29 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 04 Apr 2012 02:42:30 -0700 (PDT) From: Daniel Lezcano To: tony@atomide.com, khilman@ti.com Cc: j-pihet@ti.com, santosh.shilimkar@ti.com, rob.lee@linaro.org, linaro-dev@lists.linaro.org, patches@linaro.org Subject: [PATCH 06/17] ARM: OMAP4: cpuidle - use the omap4_idle_data variable directly Date: Wed, 4 Apr 2012 11:42:08 +0200 Message-Id: <1333532539-10298-7-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1333532539-10298-1-git-send-email-daniel.lezcano@linaro.org> References: <1333532539-10298-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQkx0Lg4Ov0W6OsrbuiOWCQocfaW7qCyuVEli5bmSJu8IbKIIchxpo+s7tN7+A2BAkz47B1l We are storing the 'omap4_idle_data' in the private data field if the cpuidle device. As we are using this variable only in this file, that does not really make sense. Let's use the global variable directly instead dereferencing pointers in an idle critical loop. Also, that simplfies the code. Signed-off-by: Daniel Lezcano Reviewed-by: Jean Pihet Reviewed-by: Santosh Shilimkar --- arch/arm/mach-omap2/cpuidle44xx.c | 15 ++++----------- 1 files changed, 4 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c index 5b20115..b82f9fe 100644 --- a/arch/arm/mach-omap2/cpuidle44xx.c +++ b/arch/arm/mach-omap2/cpuidle44xx.c @@ -24,7 +24,7 @@ #ifdef CONFIG_CPU_IDLE -/* Machine specific information to be recorded in the C-state driver_data */ +/* Machine specific information */ struct omap4_idle_statedata { u32 cpu_state; u32 mpu_logic_state; @@ -67,8 +67,7 @@ static int omap4_enter_idle(struct cpuidle_device *dev, struct cpuidle_driver *drv, int index) { - struct omap4_idle_statedata *cx = - cpuidle_get_statedata(&dev->states_usage[index]); + struct omap4_idle_statedata *cx = &omap4_idle_data[index]; u32 cpu1_state; int cpu_id = smp_processor_id(); @@ -85,7 +84,7 @@ static int omap4_enter_idle(struct cpuidle_device *dev, cpu1_state = pwrdm_read_pwrst(cpu1_pd); if (cpu1_state != PWRDM_POWER_OFF) { index = drv->safe_state_index; - cx = cpuidle_get_statedata(&dev->states_usage[index]); + cx = &omap4_idle_data[index]; } if (index > 0) @@ -178,15 +177,9 @@ static inline struct omap4_idle_statedata *_fill_cstate_usage( int idx) { struct omap4_idle_statedata *cx = &omap4_idle_data[idx]; - struct cpuidle_state_usage *state_usage = &dev->states_usage[idx]; - - cpuidle_set_statedata(state_usage, cx); - return cx; } - - /** * omap4_idle_init - Init routine for OMAP4 idle * @@ -196,8 +189,8 @@ static inline struct omap4_idle_statedata *_fill_cstate_usage( int __init omap4_idle_init(void) { struct omap4_idle_statedata *cx; - struct cpuidle_device *dev; struct cpuidle_driver *drv = &omap4_idle_driver; + struct cpuidle_device *dev; unsigned int cpu_id = 0; mpu_pd = pwrdm_lookup("mpu_pwrdm");