From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Fri, 1 May 2015 20:05:12 -0500 Subject: [U-Boot] [U-Boot,05/10] mtd: nand: s3c: Add S3C2440 specifics In-Reply-To: <201505020248.29430.marex@denx.de> References: <1413045778-5690-5-git-send-email-marex@denx.de> <20141127022053.GA26896@home.buserror.net> <201505020248.29430.marex@denx.de> Message-ID: <1430528712.16357.205.camel@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 Sat, 2015-05-02 at 02:48 +0200, Marek Vasut wrote: > On Thursday, November 27, 2014 at 03:20:53 AM, Scott Wood wrote: > > On Sat, Oct 11, 2014 at 06:42:53PM +0200, Marek Vasut wrote: > > > +#ifdef CONFIG_S3C2410 > > > + sel_reg = (uint32_t)&nand->nfconf; > > > + sel_bit = S3C2410_NFCONF_nFCE; > > > +#else > > > + sel_reg = (uint32_t)&nand->nfcont; > > > + sel_bit = S3C2440_NFCONT_nFCE; > > > +#endif > > > > Why are you casting &nand->nfcon[ft] to an integer... > > Where exactly ? sel_reg = (uint32_t)&nand->nfconf; > > > if (ctrl & NAND_NCE) > > > > > > - writel(readl(&nand->nfconf) & ~S3C2410_NFCONF_nFCE, > > > - &nand->nfconf); > > > + clrbits_le32(sel_reg, sel_bit); > > > > > > else > > > > > > - writel(readl(&nand->nfconf) | S3C2410_NFCONF_nFCE, > > > - &nand->nfconf); > > > + setbits_le32(sel_reg, sel_bit); > > > > ...only to pass that integer to something that normally accepts a > > pointer, which doesn't cause a warning only because of ARM's crappy I/O > > accessors that don't do type checking? > > > > At least the code that was there before used ulong for inappropriate > > pointer-to-integer casts rather than uint32_t. :-P > > So what do you suggest ? Store it in a proper pointer type. -Scott