From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3] imls: Add support to list images in NAND device
Date: Thu, 13 Dec 2012 15:59:01 -0600 [thread overview]
Message-ID: <1355435941.14046.9@snotra> (raw)
In-Reply-To: <770877195ea30a60d80ed240962f1386d5451926.1355395028.git.vipin.kumar@st.com> (from vipin.kumar@st.com on Thu Dec 13 04:38:18 2012)
On 12/13/2012 04:38:18 AM, Vipin Kumar wrote:
> + for (off = 0; off < nand->size; off += nand->erasesize)
> {
> + const image_header_t *header;
> + int ret;
> +
> + if (nand_block_isbad(nand, off))
> + continue;
> +
> + len = sizeof(buffer);
> +
> + ret = nand_read(nand, off, &len, (u8 *)buffer);
> + if (ret < 0 && ret != -EUCLEAN)
> + continue;
Might want to make some noise if you get an uncorrectable error.
> +
> + switch (genimg_get_format(buffer)) {
> + case IMAGE_FORMAT_LEGACY:
> + header = (const image_header_t *)buffer;
> + len = image_get_image_size(header);
> +
> + ret = nand_imls_legacyimage(nand,
> nand_dev,
> + off, len);
> + if (ret < 0 && ret != -ENOMEM)
> + return ret;
> + break;
> +#if defined(CONFIG_FIT)
> + case IMAGE_FORMAT_FIT:
> + len = fit_get_size(buffer);
> + ret = nand_imls_fitimage(nand, nand_dev,
> + off, len);
> + if (ret < 0 && ret != -ENOMEM)
> + return ret;
> + break;
> +#endif
> + }
Do you really mean to return from the main imls function just because
one image has an error? By "use return" I meant return from the
subfunction.
-Scott
next prev parent reply other threads:[~2012-12-13 21:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-13 10:38 [U-Boot] [PATCH v3] imls: Add support to list images in NAND device Vipin Kumar
2012-12-13 21:59 ` Scott Wood [this message]
2012-12-14 8:57 ` Vipin Kumar
2012-12-14 9:32 ` Vipin Kumar
2012-12-14 18:10 ` Scott Wood
[not found] <50CED650.3090000@st.com>
2012-12-18 0:05 ` Scott Wood
2012-12-18 5:04 ` Vipin Kumar
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=1355435941.14046.9@snotra \
--to=scottwood@freescale.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