From: prakash t <prakash.t@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/3] Bad block support for environment variables partition in OneNAND
Date: Fri, 16 Jan 2009 09:58:49 +0530 [thread overview]
Message-ID: <001901c97792$eebeebf0$aed66c6b@sisodomain.com> (raw)
In-Reply-To: 20090115211207.GA18090@ld0162-tx32.am.freescale.net
Hi Rohit / Moorthy,
Do we have coding guidelines from open source? Let us follow that.
It is very good that they are reviewing in depth this also means that they
are much interested in our products.
Regards,
Prakash Talawar
----- Original Message -----
From: "Scott Wood" <scottwood@freescale.com>
To: "Rohit Hagargundgi" <h.rohit@samsung.com>
Cc: <u-boot@lists.denx.de>; <k.rajesh@samsung.com>; <prakash.t@samsung.com>;
<amitsharma.9@samsung.com>
Sent: Friday, January 16, 2009 2:42 AM
Subject: Re: [U-Boot] [PATCH 1/3] Bad block support for environment
variables partition in OneNAND
> On Thu, Dec 11, 2008 at 07:58:26PM +0530, Rohit Hagargundgi wrote:
>> + env_addr = FLEXONENAND(this) ? CONFIG_ENV_ADDR_FLEX :
>> + CONFIG_ENV_ADDR;
>> +
>> + env_len = FLEXONENAND(this) ? CONFIG_ENV_SIZE_FLEX :
>> + CONFIG_ENV_SIZE;
>
> Is there any reason why this has to be done at runtime, rather than just
> using one set of CONFIG_ parameters regardless of whether it's flex?
>
>>
>> /* Check OneNAND exist */
>> - if (onenand_mtd.writesize)
>> - /* Ignore read fail */
>> - onenand_read(&onenand_mtd, env_addr, onenand_mtd.writesize,
>> - &retlen, (u_char *) env_ptr);
>> - else
>> + if (onenand_mtd.writesize) {
>> + while (env_addr < env_addr + env_len) {
>
> This is a tautology, unless you're checking for wraparound of unsigned
> long.
>
>> + onenand_get_block(this, ofs, &slc);
>> + if (slc)
>> + instr.len += 1 << (this->erase_shift -1);
>
> this->erase_shift - 1
>
>> + if (mtd->erase(mtd, &instr)) {
>> + printf("writeenv: erase failed at 0x%08lx\n", ofs);
>> + if(mtd->block_markbad(mtd, ofs))
>> + printf("writeenv: Mark bad failed at 0x%08lx\n", ofs);
>
> Space after "if".
>
> -Scott
prev parent reply other threads:[~2009-01-16 4:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-11 14:28 [U-Boot] [PATCH 1/3] Bad block support for environment variables partition in OneNAND Rohit Hagargundgi
2009-01-15 21:12 ` Scott Wood
2009-01-16 4:28 ` prakash t [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='001901c97792$eebeebf0$aed66c6b@sisodomain.com' \
--to=prakash.t@samsung.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox