From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Babic Date: Tue, 06 Mar 2012 13:23:14 +0100 Subject: [U-Boot] [PATCH] i.MX6: imx_ccm is a constant that points to a register set In-Reply-To: <1330965246-21031-1-git-send-email-eric.nelson@boundarydevices.com> References: <1330965246-21031-1-git-send-email-eric.nelson@boundarydevices.com> Message-ID: <4F5601B2.9020202@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 05/03/2012 17:34, Eric Nelson wrote: Hi Eric, > If we're going to use globals to point at register banks, they > should be constant and visible. > --- ok, but why are we going to use global pointers ? We have global constants (in imx-regs.h) and each part of code sets its local copy without using global pointers, that require also some rules and naming conventions to avoid conflicts. > arch/arm/cpu/armv7/mx6/clock.c | 2 +- > arch/arm/include/asm/arch-mx6/imx-regs.h | 2 ++ > 2 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c > index ef98563..eb1f09b 100644 > --- a/arch/arm/cpu/armv7/mx6/clock.c > +++ b/arch/arm/cpu/armv7/mx6/clock.c > @@ -34,7 +34,7 @@ enum pll_clocks { > PLL_ENET, /* ENET PLL */ > }; > > -struct imx_ccm_reg *imx_ccm = (struct imx_ccm_reg *)CCM_BASE_ADDR; > +struct imx_ccm_reg *const imx_ccm = (struct imx_ccm_reg *)CCM_BASE_ADDR; As far as I see, this is used only in clock.c - and it must be static. Best regards, Stefano Babic -- ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de =====================================================================