[PATCH v4 01/10] mtd: nand: add 'oob_required' argument to NAND {read, write}_page interfaces

Shmulik Ladkani shmulik.ladkani at gmail.com
Thu May 3 13:43:07 EDT 2012


Hi Mike,

On Thu, 03 May 2012 10:16:53 -0700 Mike Dunn <mikedunn at newsguy.com> wrote:
> I wonder why the new argument type is int instead of bool.  Sorry if this was
> already discussed... I didn't follow the earlier discussions very closely.

Well, Brian's initial post correctly had a 'bool' parameter in the
suggested interface.

I pointed out that within MTD code, 'int' is very widely used to
indicate boolean types, so I suggested changing to 'int' for consistency
with all other MTD interfaces.

> Still, it seems inconsistent.  When calling the functions, you sometimes pass
> the bool form...
> 
> > -	status = docg4_read_page(mtd, nand, buf, DOCG4_FACTORY_BBT_PAGE);
> > +	status = docg4_read_page(mtd, nand, buf, false, DOCG4_FACTORY_BBT_PAGE);
> 
> and sometimes the int form...
> 
> > -	chip->ecc.read_page_raw(mtd, chip, buf, page);
> > +	chip->ecc.read_page_raw(mtd, chip, buf, 1, page);

I guess the 'true/false' arguments are leftovers from Brian's previous
posts...

I noted these while reviewing, and personally don't mind them, but I
guess '0/1' are more appropriate.

Regards,
Shmulik



More information about the linux-mtd mailing list