diff mbox

[07/21] ARM: tegra: unify tegra_idle_device definitions

Message ID 1366734653-488286-8-git-send-email-arnd@arndb.de (mailing list archive)
State New, archived
Headers show

Commit Message

Arnd Bergmann April 23, 2013, 4:30 p.m. UTC
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 <arnd@arndb.de>
Cc: Stephen Warren <swarren@nvidia.com>
Cc: Joseph Lo <josephl@nvidia.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 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(-)

Comments

Arnd Bergmann April 23, 2013, 6:57 p.m. UTC | #1
On Tuesday 23 April 2013, Daniel Lezcano wrote:
> the patch sounds good but I think the side effect of the consolidation
> patchset [1] fixed that.
> 
> You can find these fixes in Rafael's tree:
> 
> https://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&amp;id=4c637b2175a0dc65d533494225525c6c82d73293
> 
> https://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&amp;id=e158f9da6974cc11bfab2246a9b10021af0e0d8a
> 
> https://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&amp;id=c5106c9dea9a6022ab84c6cb1d4a0b19fc5af0e2
> 
> https://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&amp;id=f040c26ffaa5e56f2bca427c719c9601a02e70e5
> 
> [1] http://www.spinics.net/lists/arm-kernel/msg239811.html
> 

Ah. Is that not in linux-next? I created the patch today based on the latest
linux-next from today (Tuesday).

	Arnd
Daniel Lezcano April 23, 2013, 10:04 p.m. UTC | #2
On 04/23/2013 08:57 PM, Arnd Bergmann wrote:
> On Tuesday 23 April 2013, Daniel Lezcano wrote:
>> the patch sounds good but I think the side effect of the consolidation
>> patchset [1] fixed that.
>>
>> You can find these fixes in Rafael's tree:
>>
>> https://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&amp;id=4c637b2175a0dc65d533494225525c6c82d73293
>>
>> https://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&amp;id=e158f9da6974cc11bfab2246a9b10021af0e0d8a
>>
>> https://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&amp;id=c5106c9dea9a6022ab84c6cb1d4a0b19fc5af0e2
>>
>> https://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&amp;id=f040c26ffaa5e56f2bca427c719c9601a02e70e5
>>
>> [1] http://www.spinics.net/lists/arm-kernel/msg239811.html
>>
> 
> Ah. Is that not in linux-next? I created the patch today based on the latest
> linux-next from today (Tuesday).

Ah, ok. Actually the patches were taken by Rafael right today. So it is
possible the changes were not reflected in linux-next yet.
Joseph Lo April 24, 2013, 2:56 a.m. UTC | #3
On Wed, 2013-04-24 at 06:04 +0800, Daniel Lezcano wrote:
> On 04/23/2013 08:57 PM, Arnd Bergmann wrote:
> > On Tuesday 23 April 2013, Daniel Lezcano wrote:
> >> the patch sounds good but I think the side effect of the consolidation
> >> patchset [1] fixed that.
> >>
> >> You can find these fixes in Rafael's tree:
> >>
> >> https://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&amp;id=4c637b2175a0dc65d533494225525c6c82d73293
> >>
> >> https://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&amp;id=e158f9da6974cc11bfab2246a9b10021af0e0d8a
> >>
> >> https://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&amp;id=c5106c9dea9a6022ab84c6cb1d4a0b19fc5af0e2
> >>
> >> https://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&amp;id=f040c26ffaa5e56f2bca427c719c9601a02e70e5
> >>
> >> [1] http://www.spinics.net/lists/arm-kernel/msg239811.html
> >>
> > 
> > Ah. Is that not in linux-next? I created the patch today based on the latest
> > linux-next from today (Tuesday).
> 
> Ah, ok. Actually the patches were taken by Rafael right today. So it is
> possible the changes were not reflected in linux-next yet.
> 
Hi Arnd and Daniel,

Thanks for taking care this.:)

Joseph
diff mbox

Patch

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 <asm/cpuidle.h>
 
+#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 <linux/cpuidle.h>
+
+DECLARE_PER_CPU(struct cpuidle_device, tegra_idle_device);
+
 #ifdef CONFIG_ARCH_TEGRA_2x_SOC
 int tegra20_cpuidle_init(void);
 #else