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

Boris Brezillon boris.brezillon at free-electrons.com
Thu Mar 30 01:34:01 PDT 2017


On Thu, 30 Mar 2017 16:01:04 +0800
Peter Pan <peterpansjtu at 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?



More information about the linux-mtd mailing list