[PATCH v2 04/10] arm: zynq: Load scu baseaddress at run time

Arnd Bergmann arnd at arndb.de
Wed Mar 27 05:29:45 EDT 2013


On Wednesday 27 March 2013, Michal Simek wrote:
> 2013/3/26 Arnd Bergmann <arnd at arndb.de>:
> > On Tuesday 26 March 2013, Michal Simek wrote:
> >> +void __iomem *scu_base;
> >> +
> >
> > This cannot be a global variable in a multiplatform kernel. Can you
> > make it static?
> 
> This global variable is shared because I am using it in smp code
> and also it will be used in pm code we have.
> 
> What is it another way how to handle this?
> 
> Because the same problem could be with zynq_slcr_base.
> 
> Or the rule is just to use zynq_ prefix for all global variables?
> 

Yes. The best solution is to mke variables local to some context and
only pointed to by other data structures. If that doesn't work, you
should try using a static variable in one file and move all code using
it there. If that doesn't work, you need a global variable, but that
must be uniquely named.

	Arnd



More information about the linux-arm-kernel mailing list