Message ID | 20181211080759.3150-2-linus.walleij@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/5] ARM: actions: Put OF nodes after use | expand |
On Tue, Dec 11, 2018 at 09:07:56AM +0100, Linus Walleij wrote: > The ncores and scu_base_addr variables are only used > inside s500_smp_prepare_cpus() so no need to have them > static local. > > Signed-off-by: Linus Walleij <linus.walleij@linaro.org> > --- > arch/arm/mach-actions/platsmp.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/arch/arm/mach-actions/platsmp.c b/arch/arm/mach-actions/platsmp.c > index 02d17ed0ca31..98fbcaa764a5 100644 > --- a/arch/arm/mach-actions/platsmp.c > +++ b/arch/arm/mach-actions/platsmp.c > @@ -34,11 +34,8 @@ > #define OWL_SPS_PG_CTL_ACK_CPU2 BIT(21) > #define OWL_SPS_PG_CTL_ACK_CPU3 BIT(22) > > -static void __iomem *scu_base_addr; > static void __iomem *sps_base_addr; > static void __iomem *timer_base_addr; > -static int ncores; > - > static DEFINE_SPINLOCK(boot_lock); > > void owl_secondary_startup(void); > @@ -113,7 +110,9 @@ static int s500_smp_boot_secondary(unsigned int cpu, struct task_struct *idle) > > static void __init s500_smp_prepare_cpus(unsigned int max_cpus) > { > + static void __iomem *scu_base_addr; > struct device_node *node; > + static int ncores; Do these need to be static? We only prepare once.
+ linux-actions Am 11.12.18 um 09:07 schrieb Linus Walleij: > The ncores and scu_base_addr variables are only used > inside s500_smp_prepare_cpus() so no need to have them > static local. > > Signed-off-by: Linus Walleij <linus.walleij@linaro.org> > --- > arch/arm/mach-actions/platsmp.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/arch/arm/mach-actions/platsmp.c b/arch/arm/mach-actions/platsmp.c > index 02d17ed0ca31..98fbcaa764a5 100644 > --- a/arch/arm/mach-actions/platsmp.c > +++ b/arch/arm/mach-actions/platsmp.c > @@ -34,11 +34,8 @@ > #define OWL_SPS_PG_CTL_ACK_CPU2 BIT(21) > #define OWL_SPS_PG_CTL_ACK_CPU3 BIT(22) > > -static void __iomem *scu_base_addr; > static void __iomem *sps_base_addr; > static void __iomem *timer_base_addr; > -static int ncores; > - > static DEFINE_SPINLOCK(boot_lock); > > void owl_secondary_startup(void); > @@ -113,7 +110,9 @@ static int s500_smp_boot_secondary(unsigned int cpu, struct task_struct *idle) > > static void __init s500_smp_prepare_cpus(unsigned int max_cpus) > { > + static void __iomem *scu_base_addr; > struct device_node *node; > + static int ncores; > > node = of_find_compatible_node(NULL, NULL, "actions,s500-timer"); > if (!node) { I fail to see what's wrong about the code, so I would rather not needlessly refactor it. Regards, Andreas
diff --git a/arch/arm/mach-actions/platsmp.c b/arch/arm/mach-actions/platsmp.c index 02d17ed0ca31..98fbcaa764a5 100644 --- a/arch/arm/mach-actions/platsmp.c +++ b/arch/arm/mach-actions/platsmp.c @@ -34,11 +34,8 @@ #define OWL_SPS_PG_CTL_ACK_CPU2 BIT(21) #define OWL_SPS_PG_CTL_ACK_CPU3 BIT(22) -static void __iomem *scu_base_addr; static void __iomem *sps_base_addr; static void __iomem *timer_base_addr; -static int ncores; - static DEFINE_SPINLOCK(boot_lock); void owl_secondary_startup(void); @@ -113,7 +110,9 @@ static int s500_smp_boot_secondary(unsigned int cpu, struct task_struct *idle) static void __init s500_smp_prepare_cpus(unsigned int max_cpus) { + static void __iomem *scu_base_addr; struct device_node *node; + static int ncores; node = of_find_compatible_node(NULL, NULL, "actions,s500-timer"); if (!node) {
The ncores and scu_base_addr variables are only used inside s500_smp_prepare_cpus() so no need to have them static local. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> --- arch/arm/mach-actions/platsmp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)