Re: [PATCH v3 2/8] mtd: nand: add oob iterator in nand_for_each_page

Peter Pan
2017-03-20T04:53:10Z

Hi Boris,

On Fri, Mar 17, 2017 at 9:11 PM, Boris Brezillon
<boris.brezillon@free-electrons.com> wrote:
> On Thu, 16 Mar 2017 14:47:31 +0800
> Peter Pan <peterpandong@micron.com> wrote:
>
>> Iterate nand pages by both page and oob operation.
>>
>> Signed-off-by: Peter Pan <peterpandong@micron.com>
>> ---
>> include/linux/mtd/nand.h | 28 +++++++++++++++++++++++++---
>> 1 file changed, 25 insertions(+), 3 deletions(-)
>>
>> diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
>> index 4a812e6..822547e 100644
>> --- a/include/linux/mtd/nand.h
>> +++ b/include/linux/mtd/nand.h
>> @@ -87,6 +87,9 @@ struct nand_page_iter {
>> loff_t offs;
>> int page;
>> int pageoffs;
>> + int ooboffs;
>> + int oobsize;
>> + size_t oobleft;
>
> Maybe we should also add dataleft so that you don't have to pass start
> and len when you call nand_page_iter_end().

Yes, it's better. Fix this in v4

Thanks,
Peter Pan