From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ivan Khoronzhuk Date: Fri, 20 Jun 2014 20:10:19 +0300 Subject: [U-Boot] [U-Boot, U-boot, 1/2] common: cmd_nand: add nand ecclayout command In-Reply-To: <1403280181.12851.181.camel@snotra.buserror.net> References: <1400264797-3593-2-git-send-email-ivan.khoronzhuk@ti.com> <20140620010012.GA5906@home.buserror.net> <53A43752.2080400@ti.com> <1403280181.12851.181.camel@snotra.buserror.net> Message-ID: <53A46AFB.2050506@ti.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 06/20/2014 07:03 PM, Scott Wood wrote: > On Fri, 2014-06-20 at 09:10 -0500, Jon Loeliger wrote: >>>>> --- a/common/cmd_nand.c >>>>> +++ b/common/cmd_nand.c >>>>> @@ -462,6 +462,53 @@ static void adjust_size_for_badblocks(loff_t *size, >>>>> + for (i = 0; i < p->eccbytes; i++) { >>>>> + if (i && !(i % 9)) >>>>> + printf("\n "); >>>>> + >>>>> + printf("%2d ", p->eccpos[i]); >>>>> + } >>>> Why 9? >>> >>> It's to print a new line on every 9th character position. >>> I'll add a comment. >> OK, Scott, breath... I got this one. It'll be OK... >> >> Ivan, >> I am confident Scott understood that a newline would >> be generated every ninth-character. We all get that. I think >> what Scott was asking was why the value 9 was chosen? >> Why not 10? Or 8? Or 145? Was it to fit some arbitrary >> line length or screen size? Would it make more sense to >> use something familiar like a base 10 or half of base-16? > More specifically, it neither avoids a division (as a power of two > would) nor does it seem to match the ecc size of the layouts used by the > davinci driver (which is the only user of this so far), nor is it > anywhere near 80 columns. > > Also, why is the field width two characters, when ecc positions can > exceed 100? > > -Scott > > Ok, I'll try to correct as you proposed. I dislike it also ... Thanks. -- Regards, Ivan Khoronzhuk