From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Tue, 29 Jul 2014 06:21:14 +0200 Subject: [U-Boot] [PATCH 03/12] mtd: nand: s3c: Fix data type width in debug() In-Reply-To: <1406596949.29414.218.camel@snotra.buserror.net> References: <1405989293-6629-1-git-send-email-marex@denx.de> <201407290311.41480.marex@denx.de> <1406596949.29414.218.camel@snotra.buserror.net> Message-ID: <201407290621.14743.marex@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 Tuesday, July 29, 2014 at 03:22:29 AM, Scott Wood wrote: > On Tue, 2014-07-29 at 03:11 +0200, Marek Vasut wrote: > > On Tuesday, July 29, 2014 at 02:12:47 AM, Scott Wood wrote: > > > On Tue, 2014-07-29 at 02:09 +0200, Marek Vasut wrote: > > > > On Tuesday, July 29, 2014 at 01:35:57 AM, Scott Wood wrote: > > > > > On Tue, 2014-07-22 at 02:34 +0200, Marek Vasut wrote: > > > > > > Printing u32 with %02x is just a bad idea, fix it. > > > > > > > > > > Why is it "just a bad idea" if the values aren't expected to exceed > > > > > 0xff? > > > > > > > > NAND_CMD_DEPLETE1 is 0x100 for example. I doubt anyone will use AND > > > > with this controller, but I'd be much happier to see the print > > > > properly matching the variable we're printing. > > > > > > It will match it. %02x doesn't restrict the output to two characters; > > > it just makes sure there are at least two characters. > > > > The output with %02x in this case is 0xffffffXY , so there is something > > really wrong going on. With %08x, the output is as expected (because > > that does match ths size of the variable). > > Is that for NAND_CMD_NONE which is -1? Or something else? OK, now it makes sense. > Also regarding the changelog, neither of these values are declared as > u32. They're int and unsigned int, which on ARMv7 and lower (this is armv4) is 32bit with GCC. Best regards, Marek Vasut