From: Scott Wood Date: Thu, 8 Apr 2010 12:15:55 -0500 Subject: [U-Boot] [PATCH] fsl-diu: Using I/O accessor to CCSR space In-Reply-To: <39784B5B-953F-4973-9193-37F9D0E51666@kernel.crashing.org> References: <1270623077-23603-1-git-send-email-daveliu@freescale.com> <39784B5B-953F-4973-9193-37F9D0E51666@kernel.crashing.org> Message-ID: <20100408171555.GA10742@loki.buserror.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, Apr 08, 2010 at 02:27:01AM -0500, Kumar Gala wrote: > > On Apr 8, 2010, at 1:14 AM, Liu Dave-R63238 wrote: > > >>> @@ -369,8 +370,8 @@ static int fsl_diu_enable_panel(struct > >> fb_info *info) > >>> struct diu_ad *ad = &fsl_diu_fb_ad; > >>> > >>> debug("Entered: enable_panel\n"); > >>> - if (hw->desc[0] != (unsigned int)ad) > >>> - hw->desc[0] = (unsigned int)ad; > >>> + if (in_be32(&hw->desc[0]) != (unsigned int)ad) > >>> + out_be32(&hw->desc[0], ad); > > > >> 'ad' should be cast to a u32, not an "unsigned int". You > >> shouldn't compare a sized type with an unsized type. > > > > Grep the include/asm-ppc/types.h, I got typedef unsigned int u32; > > The u32 is same as "unsigned int". > > > > Kumar, any comments? > > Timur is correct, while u32 is typedef to 'unsigned int' its cleaner in > the code to use u32 and if we have a 64-bit port of u-boot on PPC in the > future it makes things cleaner. If we have a 64-bit port of u-boot, then casting a pointer to u32 will still be broken... -Scott