Re: [PATCH v4 1/9] mtd: nand: add oob iterator in nand_for_each_page

Boris Brezillon
2017-03-30T08:34:36Z

On Thu, 30 Mar 2017 16:01:04 +0800
Peter Pan <peterpansjtu@gmail.com> wrote:
>
> >
> >> */
> >> struct nand_page_iter {
> >> - loff_t offs;
> >> int page;
> >> int pageoffs;
> >> + size_t dataleft;
> >> + int ooboffs;
> >> + int oobsize;
> >
> > oobsize can be extracted from nand_device, and since a nand_device
> > object it passed to all nand_page_iter_xxx() functions you don't need it
> > here.
>
> Er.. I think we can not get oobsize from nand_device, since oobsize is
> determined
> by mtd_oob_ops.mode, it can be mtd->oobavail or mtd->oobsize. What do
> you think Boris?

Correct, I forgot about this aspect. Ignore my previous comment and try
to find a better name for this field (+ document it). How about
oobbytes_per_page?