[PATCH 2/3] mtd: nand: remove autoincrement 'sndcmd' code

Shmulik Ladkani shmulik.ladkani at gmail.com
Thu May 3 02:17:24 EDT 2012


Hi Brian,

Sorry for the late response.
(I'm following the posts, but obviously can't take a deep look
immediately)

On Tue,  1 May 2012 17:12:54 -0700 Brian Norris <computersforpeace at gmail.com> wrote:
> @@ -1842,20 +1823,15 @@ static int nand_do_read_oob(struct mtd_info *mtd, loff_t from,
>  
>  	while (1) {
>  		if (ops->mode == MTD_OPS_RAW)
> -			sndcmd = chip->ecc.read_oob_raw(mtd, chip, page, sndcmd);
> +			chip->ecc.read_oob_raw(mtd, chip, page, 1);
>  		else
> -			sndcmd = chip->ecc.read_oob(mtd, chip, page, sndcmd);
> +			chip->ecc.read_oob(mtd, chip, page, 1);


Since '1' is always passed as 'sndcmd' argument, how about killing the
'sndcmd' parameter of of these interfaces:

	int (*read_oob_raw)(struct mtd_info *mtd, struct nand_chip *chip,
			int page, int sndcmd);
	int (*read_oob)(struct mtd_info *mtd, struct nand_chip *chip, int page,
			int sndcmd);

Looks as a simplification.
At least for current code which always passes '1'.
(Don't know if we might need the 'sndcmd' ability in the future)

I can come up with a patch, but currently I have very limited testing
capabilities.

Regards,
Shmulik



More information about the linux-mtd mailing list