From patchwork Thu May 3 20:26:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 8381 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 96CE723E37 for ; Thu, 3 May 2012 20:26:41 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id 4BCD2A18369 for ; Thu, 3 May 2012 20:26:41 +0000 (UTC) Received: by yenl4 with SMTP id l4so2716592yen.11 for ; Thu, 03 May 2012 13:26:40 -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:organization:references:date:in-reply-to:message-id :user-agent:mime-version:content-type:x-gm-message-state; bh=tzyE4NCwq04NklHewufUS2EztNC7341WOlnELVKfAQ4=; b=UzuzY9A8xsH2F3QxdS7TWiVN1VqS0zzl+AFnoFXFSM+Fm9867BsYaEc4dNo0g19KdF cMaRUDL/gl+xqZmjkfe2053qazSKvZiIKzV91d/qucSuvpnoBl/Rbals3RlJtm0Y/wpr fd5O2f13voSmUEN19x2e1yAtvOTMWAPsCIG4VZ0dUggoPUsNaBEfH47K5qzRsrXetv1W Xs17JFwhDz2OEA36OwUdqseab/7ccN32gR3ZdVA9lBKr5BwVOSyFtW5J0d0/EAJChG76 csnHFvFPWEmnM88sboiAmTFVd/nYzmsICbxD85WYZFBtUt4HCeXa6iAV3GqOEdJ0rOa7 KZfg== Received: by 10.42.122.76 with SMTP id m12mr1338558icr.38.1336076800494; Thu, 03 May 2012 13:26:40 -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.137.198 with SMTP id x6csp46642ibt; Thu, 3 May 2012 13:26:39 -0700 (PDT) Received: by 10.68.136.65 with SMTP id py1mr11095175pbb.81.1336076799374; Thu, 03 May 2012 13:26:39 -0700 (PDT) Received: from na3sys009aog136.obsmtp.com ([74.125.149.85]) by mx.google.com with SMTP id jo6si6484902pbc.69.2012.05.03.13.26.38 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 03 May 2012 13:26:39 -0700 (PDT) Received-SPF: pass (google.com: domain of khilman@ti.com designates 74.125.149.85 as permitted sender) client-ip=74.125.149.85; Authentication-Results: mx.google.com; spf=pass (google.com: domain of khilman@ti.com designates 74.125.149.85 as permitted sender) smtp.mail=khilman@ti.com Received: from mail-pb0-f53.google.com ([209.85.160.53]) (using TLSv1) by na3sys009aob136.postini.com ([74.125.148.12]) with SMTP ID DSNKT6Lp/r59Qi08fMMg0IphLh749NRkoc/C@postini.com; Thu, 03 May 2012 13:26:39 PDT Received: by pbbrr13 with SMTP id rr13so3243831pbb.12 for ; Thu, 03 May 2012 13:26:38 -0700 (PDT) Received: by 10.68.190.229 with SMTP id gt5mr11418923pbc.59.1336076797943; Thu, 03 May 2012 13:26:37 -0700 (PDT) Received: from localhost (c-24-19-7-36.hsd1.wa.comcast.net. [24.19.7.36]) by mx.google.com with ESMTPS id if8sm568850pbc.15.2012.05.03.13.26.35 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 03 May 2012 13:26:36 -0700 (PDT) From: Kevin Hilman To: Daniel Lezcano Cc: santosh.shilimkar@ti.com, jean.pihet@newoldbits.com, tony@atomide.com, linux-omap@vger.kernel.org, linaro-dev@lists.linaro.org, linux-arm-kernel@lists.infradead.org, patches@linaro.org Subject: Re: [PATCH 18/18][V3] ARM: OMAP3: cpuidle - set global variables static Organization: Texas Instruments, Inc. References: <1335276339-11135-1-git-send-email-daniel.lezcano@linaro.org> <1335276339-11135-19-git-send-email-daniel.lezcano@linaro.org> Date: Thu, 03 May 2012 13:26:40 -0700 In-Reply-To: <1335276339-11135-19-git-send-email-daniel.lezcano@linaro.org> (Daniel Lezcano's message of "Tue, 24 Apr 2012 16:05:39 +0200") Message-ID: <878vh9ko3j.fsf@ti.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 X-Gm-Message-State: ALoCoQnfgIaBfS4EIPse+BTvllNkbRRrJI+uNHacW5hxMpUwd3Tgj045KgvDJuHXsySrf9sizDZY Daniel Lezcano writes: > and check the powerdomain lookup is successful. > > Signed-off-by: Daniel Lezcano > Reviewed-by: Jean Pihet > --- > arch/arm/mach-omap2/cpuidle34xx.c | 5 ++++- > 1 files changed, 4 insertions(+), 1 deletions(-) > > diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c > index 0d28596..116a0d8 100644 > --- a/arch/arm/mach-omap2/cpuidle34xx.c > +++ b/arch/arm/mach-omap2/cpuidle34xx.c > @@ -73,7 +73,7 @@ static struct omap3_idle_statedata omap3_idle_data[] = { > }, > }; > > -struct powerdomain *mpu_pd, *core_pd, *per_pd, *cam_pd; > +static struct powerdomain *mpu_pd, *core_pd, *per_pd, *cam_pd; > > static int _cpuidle_allow_idle(struct powerdomain *pwrdm, > struct clockdomain *clkdm) > @@ -252,6 +252,9 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev, > * its own code. > */ > > + if (!mpu_pd || !core_pd || !per_pd || !cam_pd) > + return -ENODEV; > + Why check here? cam_pd is actually used just above this code. Also, this is in the fast path. This should just be checked once at init time instead of every idle path. For those reasons, I've dropped this part of the patch (updated patch below.) If desired, you can send an additional patch that adds this error checking at init time and then refuses to register the driver if any of the pwrdms don't exist. Kevin >From 7870c78d0343ab39050bec01d88cdb19245fdaa9 Mon Sep 17 00:00:00 2001 From: Daniel Lezcano Date: Tue, 24 Apr 2012 16:05:39 +0200 Subject: [PATCH] ARM: OMAP3: cpuidle - set global variables static struct powerdomain varialbes are all file local, make them static. Signed-off-by: Daniel Lezcano Reviewed-by: Jean Pihet Reviewed-by: Santosh Shilimkar Tested-by: Santosh Shilimkar Tested-by: Kevin Hilman [khilman@ti.com: update changelog, drop error check in fast path] Signed-off-by: Kevin Hilman --- arch/arm/mach-omap2/cpuidle34xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index 0d28596..9429c65 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c @@ -73,7 +73,7 @@ static struct omap3_idle_statedata omap3_idle_data[] = { }, }; -struct powerdomain *mpu_pd, *core_pd, *per_pd, *cam_pd; +static struct powerdomain *mpu_pd, *core_pd, *per_pd, *cam_pd; static int _cpuidle_allow_idle(struct powerdomain *pwrdm, struct clockdomain *clkdm)