[PATCH 1/5] UBI: fastmap: add more TODOs

Artem Bityutskiy dedekind1 at gmail.com
Wed Jun 6 19:38:12 EDT 2012


On Wed, 2012-06-06 at 23:30 +0200, Richard Weinberger wrote:
> I'm confused to find bad PEBs I'd still need a full scan, right?

If full scan means call mtd_block_isbad() for each PEB, then yes.

> >  	ret = ubi_io_read(ubi, fmsb, sb_pnum, ubi->leb_start, sizeof(*fmsb));
> >  	if (ret && ret != UBI_IO_BITFLIPS) {
> > +		/* TODO: what are the error codes > 0 ? Why is this check? */
> 
> To catch UBI_IO_BAD_HDR, UBI_IO_BAD_HDR_EBADMSG and friends.

Which are never returned by ubi_io_read().

> AFAIK ->magic is the only __b32 field where I not use be32_to_cpu() because it's useless here.

Why is it useless?

if we have the following bytes starting from address 0xC0000000:
7B 11 D6 9F

then we do:

unsigned int *p = 0xC0000000;
printk("%#x\n", *p);

we should see:

0x7B11D69F on BE system (e.g., powerpc)
and
0x9FD6117B on LE system (e.g., x86).

-- 
Best Regards,
Artem Bityutskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20120607/96508bcf/attachment.sig>


More information about the linux-mtd mailing list