From patchwork Tue Apr 23 16:30:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 2479241 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id EE2753FD1A for ; Tue, 23 Apr 2013 17:10:45 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UUgiI-0001DJ-D4; Tue, 23 Apr 2013 17:09:08 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UUgBT-0005zC-NH; Tue, 23 Apr 2013 16:35:11 +0000 Received: from moutng.kundenserver.de ([212.227.126.171]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UUg8N-0005fn-Fw for linux-arm-kernel@lists.infradead.org; Tue, 23 Apr 2013 16:32:15 +0000 Received: from wuerfel.lan (HSI-KBW-095-208-002-043.hsi5.kabel-badenwuerttemberg.de [95.208.2.43]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0M36xf-1UkpIw3nbb-00sfnY; Tue, 23 Apr 2013 18:31:50 +0200 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 07/21] ARM: tegra: unify tegra_idle_device definitions Date: Tue, 23 Apr 2013 18:30:39 +0200 Message-Id: <1366734653-488286-8-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1366734653-488286-1-git-send-email-arnd@arndb.de> References: <1366734653-488286-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:8nhlNs6ppyK1rtbrpLwAEDiIt9OYpb7VlLkxfxs0v2q qlHzqs+5dxKuZ5ArxPSxJdau/G6cbjzRZR1330vCog175+4Mni BM0YyYl3ejvZk5zfkhipWQOqZXGYnQHpcVl4CI0EK0/4OqwqFs RGerbROEyYpc+cri3ASszVDuXgKlinOPmqSBp6YkW0VCv59U1V 1zf0TjsUH1e5ABUapSK7t5j1nC1LcWKgWTqGP2Ru1ihJokc+4V wJ0CYFXVyp/M1Au4yAzVkhGiX0E9Rhcr7q6uhxaFgZU7zOSiZB lXnm9v+XKM8Rr3aD5Q1Bc/7NuTbEroy80eQAMoXBrdfWbTTmCW LP6ve86yC4Ad1YUkMsNZKSc/BBpVif0whLZC2sE7q X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130423_123159_887591_87C7BAE3 X-CRM114-Status: GOOD ( 14.98 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.126.171 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Daniel Lezcano , Stephen Warren , Arnd Bergmann , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Joseph Lo X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The three tegra variants (20, 30, 114) each define their own per-cpu variable for tegra_idle_device, which causes link errors when you build the kernel for more than one of them: cpuidle-tegra30.o:(.discard+0x0): multiple definition of `__pcpu_unique_tegra_idle_device' cpuidle-tegra20.o:(.discard+0x0): first defined here cpuidle-tegra114.o:(.discard+0x0): multiple definition of `__pcpu_unique_tegra_idle_device' cpuidle-tegra20.o:(.discard+0x0): first defined here By moving the variable into the common cpuidle.c file, we save a little bit of object code size and avoid that warning. As a bonus, this patch also removes the unused "drv" variables in each of the three files that caused a warning since 0697598db "ARM: tegra: cpuidle: remove useless initialization". Signed-off-by: Arnd Bergmann Cc: Stephen Warren Cc: Joseph Lo Cc: Daniel Lezcano Cc: Rafael J. Wysocki --- arch/arm/mach-tegra/cpuidle-tegra114.c | 5 ++--- arch/arm/mach-tegra/cpuidle-tegra20.c | 4 +--- arch/arm/mach-tegra/cpuidle-tegra30.c | 4 +--- arch/arm/mach-tegra/cpuidle.c | 2 ++ arch/arm/mach-tegra/cpuidle.h | 4 ++++ 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-tegra/cpuidle-tegra114.c b/arch/arm/mach-tegra/cpuidle-tegra114.c index 0f4e8c4..09067a1 100644 --- a/arch/arm/mach-tegra/cpuidle-tegra114.c +++ b/arch/arm/mach-tegra/cpuidle-tegra114.c @@ -20,6 +20,8 @@ #include +#include "cpuidle.h" + static struct cpuidle_driver tegra_idle_driver = { .name = "tegra_idle", .owner = THIS_MODULE, @@ -30,14 +32,11 @@ static struct cpuidle_driver tegra_idle_driver = { }, }; -static DEFINE_PER_CPU(struct cpuidle_device, tegra_idle_device); - int __init tegra114_cpuidle_init(void) { int ret; unsigned int cpu; struct cpuidle_device *dev; - struct cpuidle_driver *drv = &tegra_idle_driver; ret = cpuidle_register_driver(&tegra_idle_driver); if (ret) { diff --git a/arch/arm/mach-tegra/cpuidle-tegra20.c b/arch/arm/mach-tegra/cpuidle-tegra20.c index 825ced4..c811328 100644 --- a/arch/arm/mach-tegra/cpuidle-tegra20.c +++ b/arch/arm/mach-tegra/cpuidle-tegra20.c @@ -36,6 +36,7 @@ #include "iomap.h" #include "irq.h" #include "flowctrl.h" +#include "cpuidle.h" #ifdef CONFIG_PM_SLEEP static bool abort_flag; @@ -67,8 +68,6 @@ static struct cpuidle_driver tegra_idle_driver = { .en_core_tk_irqen = 1, }; -static DEFINE_PER_CPU(struct cpuidle_device, tegra_idle_device); - #ifdef CONFIG_PM_SLEEP #ifdef CONFIG_SMP static void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE); @@ -220,7 +219,6 @@ int __init tegra20_cpuidle_init(void) int ret; unsigned int cpu; struct cpuidle_device *dev; - struct cpuidle_driver *drv = &tegra_idle_driver; #ifdef CONFIG_PM_SLEEP tegra_tear_down_cpu = tegra20_tear_down_cpu; diff --git a/arch/arm/mach-tegra/cpuidle-tegra30.c b/arch/arm/mach-tegra/cpuidle-tegra30.c index 8b50cf4..6187478 100644 --- a/arch/arm/mach-tegra/cpuidle-tegra30.c +++ b/arch/arm/mach-tegra/cpuidle-tegra30.c @@ -33,6 +33,7 @@ #include "pm.h" #include "sleep.h" +#include "cpuidle.h" #ifdef CONFIG_PM_SLEEP static int tegra30_idle_lp2(struct cpuidle_device *dev, @@ -65,8 +66,6 @@ static struct cpuidle_driver tegra_idle_driver = { }, }; -static DEFINE_PER_CPU(struct cpuidle_device, tegra_idle_device); - #ifdef CONFIG_PM_SLEEP static bool tegra30_cpu_cluster_power_down(struct cpuidle_device *dev, struct cpuidle_driver *drv, @@ -160,7 +159,6 @@ int __init tegra30_cpuidle_init(void) int ret; unsigned int cpu; struct cpuidle_device *dev; - struct cpuidle_driver *drv = &tegra_idle_driver; #ifdef CONFIG_PM_SLEEP tegra_tear_down_cpu = tegra30_tear_down_cpu; diff --git a/arch/arm/mach-tegra/cpuidle.c b/arch/arm/mach-tegra/cpuidle.c index 4b744c4..1bac560 100644 --- a/arch/arm/mach-tegra/cpuidle.c +++ b/arch/arm/mach-tegra/cpuidle.c @@ -27,6 +27,8 @@ #include "fuse.h" #include "cpuidle.h" +DEFINE_PER_CPU(struct cpuidle_device, tegra_idle_device); + static int __init tegra_cpuidle_init(void) { int ret; diff --git a/arch/arm/mach-tegra/cpuidle.h b/arch/arm/mach-tegra/cpuidle.h index d733f75..a4c5f17 100644 --- a/arch/arm/mach-tegra/cpuidle.h +++ b/arch/arm/mach-tegra/cpuidle.h @@ -17,6 +17,10 @@ #ifndef __MACH_TEGRA_CPUIDLE_H #define __MACH_TEGRA_CPUIDLE_H +#include + +DECLARE_PER_CPU(struct cpuidle_device, tegra_idle_device); + #ifdef CONFIG_ARCH_TEGRA_2x_SOC int tegra20_cpuidle_init(void); #else