From patchwork Wed Apr 4 20:12:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 7638 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 5651A23E47 for ; Wed, 4 Apr 2012 20:13:07 +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 1699AA18101 for ; Wed, 4 Apr 2012 20:13:06 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so1063293iag.11 for ; Wed, 04 Apr 2012 13:13:06 -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=tgRn4SehE3m7FU5XJHQ4Xm3WR3AMbht+cTXFODCuBso=; b=PzSK+ahClJa3RJW2pta0EcwSy1IPfvYYsUubXvq9P3PJT7MAD05/uqjnJ6lZjHiSOv T1EV0vG2ibhU1/tHTwAvTSZ27Y9jC10LNG2GSmWfdX/shXGHYfEHtfQ7+1MiXBRVYs7g OwGpQjwfHbmv3ut8i0pyiJVueXQK5DvSR42/pkk2iUTV29jsxWZXc1E6yAHlKUtWTWzC pKQ9RYdDkO7HvHYLQ3h4XHu9BrFlUS/o49XxjOR9TQcLYaArBfT+OwRqd/fJe2ED/qEB Wtb1P1Rc4bYvMS9ypbjC/WEv/jAyA2JiktAznmejkFwx7Zh8FnVEt1Kj+4NVyEwelykz 9f/A== Received: by 10.42.203.148 with SMTP id fi20mr10814591icb.10.1333570386860; Wed, 04 Apr 2012 13:13:06 -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 f25csp56466iby; Wed, 4 Apr 2012 13:13:06 -0700 (PDT) Received: by 10.213.27.194 with SMTP id j2mr38039ebc.269.1333570385537; Wed, 04 Apr 2012 13:13:05 -0700 (PDT) Received: from mail-we0-f178.google.com (mail-we0-f178.google.com [74.125.82.178]) by mx.google.com with ESMTPS id o6si3509935wiz.33.2012.04.04.13.13.05 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 04 Apr 2012 13:13:05 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=74.125.82.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.178 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-we0-f178.google.com with SMTP id a13so550985wer.37 for ; Wed, 04 Apr 2012 13:13:05 -0700 (PDT) Received: by 10.216.132.151 with SMTP id o23mr2168998wei.120.1333570385010; Wed, 04 Apr 2012 13:13:05 -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 gd4sm6869495wib.6.2012.04.04.13.13.03 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 04 Apr 2012 13:13:04 -0700 (PDT) From: Daniel Lezcano To: santosh.shilimkar@ti.com, jean.pihet@newoldbits.com, khilman@ti.com, tony@atomide.com Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, rob.lee@linaro.org, linaro-dev@lists.linaro.org, patches@linaro.org Subject: [PATCH 06/17][V2] ARM: OMAP4: cpuidle - use the omap4_idle_data variable directly Date: Wed, 4 Apr 2012 22:12:40 +0200 Message-Id: <1333570371-1389-7-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1333570371-1389-1-git-send-email-daniel.lezcano@linaro.org> References: <1333570371-1389-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQkl82TZVaYrw2qxpkYqA3/HqwjBTP5vUqzinIYBPZ3CTe2dPFYapfHgekeMKT7pz6FQkOag We are storing the 'omap4_idle_data' in the private data field of 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");