Re: [PATCH 1/7] [RFC] UBI: Export next_sqnum()

From: Artem Bityutskiy
Date: Tue May 22 2012 - 06:55:07 EST


On Mon, 2012-05-21 at 15:34 +0200, Richard Weinberger wrote:
> > fm_start = ubi_find_fastmap(ubi);
> > if (fm_start< 0)
> > + /* TODO: instead, return 1 which means that fall-back
> to
> > + * scanning is needed */
>
> fm_start is the PEB number of the fastmap super block.
> It will return 1 if the super block was found at PEB 1.
> That's why it returns a negative values in case of an error

OK, if 1 does not work - use 2, introduce your own constant. Using
-EINVAL is simply incorrect. Check what happens if the MTD driver
returns -EINVAL when you call 'ubi_io_read_vid_hdr()'.
--
Best Regards,
Artem Bityutskiy

Attachment: signature.asc
Description: This is a digitally signed message part