From mboxrd@z Thu Jan 1 00:00:00 1970 From: York Sun Date: Mon, 14 Oct 2013 12:05:52 -0700 Subject: [U-Boot] declaring and initializing variables In-Reply-To: <20131007170347.bfc63719bf95e28d508c70ee@freescale.com> References: <524A1191.90908@freescale.com> <20131007170347.bfc63719bf95e28d508c70ee@freescale.com> Message-ID: <525C4090.1030208@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 10/07/2013 03:03 PM, Kim Phillips wrote: > On Mon, 30 Sep 2013 17:04:33 -0700 > York Sun wrote: > >> Kim, et al., >> >> I know I have asked this before. Pardon me as I don't consider myself a >> savy programmer. >> >> I am cleaning up the DDR driver for mpc83xx, mpc85xx and mpc86xx. The >> question is the accetable formats of declaring and initializing variable >> at the same time. The variables are the ccsr register pointers. I have >> two formats here >> >> struct ccsr_ddr __iomem *ddr = (void *) CONFIG_FOO_ADDR; >> struct ccsr_ddr __iomem *ddr = >> (struct ccsr_ddr __iomem *) CONFIG_FOO_ADDR; >> >> You have told me the second format is preferred. I have been using this >> format since. But in practice, the second format is often too long and I >> have to wrap to next line. It's not a problem for new code. As I am >> trying to cleanup the existing code, I would have to make more changes. >> So I am back to this question. Is the first format (using void *) >> accetable in long term? > > you're not running sparse, are you? :) > > Use 'make C=1' or 'MAKEALL -C' when building u-boot. > I see what you mean. We have so many issue with existing code. Is it practical to enforce? York