public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Brian Norris <computersforpeace@gmail.com>
To: Michael Grzeschik <m.grzeschik@pengutronix.de>
Cc: dwmw2@infradead.org, linux-mtd@lists.infradead.org,
	linux-kernel@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [PATCH 1/2] mxc_nand: fix err_limit and err_mask
Date: Mon, 21 Jul 2014 20:21:14 -0700	[thread overview]
Message-ID: <20140722032114.GA28323@ld-irv-0074> (raw)
In-Reply-To: <1403815368-29469-1-git-send-email-m.grzeschik@pengutronix.de>

Hi Michael,

Since I had a few comments for changes on patch 2, might as well comment
here...

On Thu, Jun 26, 2014 at 10:42:47PM +0200, Michael Grzeschik wrote:
> This patch fixes the error detection limits for the used
> eccsize of the 1, 4 and 8 bit eccmode.
> 
> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> ---
>  drivers/mtd/nand/mxc_nand.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
> index cb6c845..7fd495e 100644
> --- a/drivers/mtd/nand/mxc_nand.c
> +++ b/drivers/mtd/nand/mxc_nand.c
> @@ -657,10 +657,14 @@ static int mxc_nand_correct_data_v2_v3(struct mtd_info *mtd, u_char *dat,
>  	u32 ecc_stat, err;
>  	int no_subpages = 1;
>  	int ret = 0;
> -	u8 ecc_bit_mask, err_limit;
> +	u8 ecc_bit_mask, err_limit = 0x1;
>  
> -	ecc_bit_mask = (host->eccsize == 4) ? 0x7 : 0xf;
> -	err_limit = (host->eccsize == 4) ? 0x4 : 0x8;
> +	ecc_bit_mask = 0xf;
> +
> +	if (host->eccsize == 4)
> +		err_limit = 0x2;
> +	else if (host->eccsize == 8)
> +		err_limit = 0x4;

This would be a little more obvious as a switch statement.

But please do address my comments on patch 2 (or at least reply, if you
have questions).

>  
>  	no_subpages = mtd->writesize >> 9;
>  

Thanks,
Brian

      parent reply	other threads:[~2014-07-22  3:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-26 20:42 [PATCH 1/2] mxc_nand: fix err_limit and err_mask Michael Grzeschik
2014-06-26 20:42 ` [PATCH 2/2] mxc_nand: use our own read_page function Michael Grzeschik
2014-06-27  9:19   ` Michael Grzeschik
2014-06-27 10:38   ` [PATH v2] " Michael Grzeschik
2014-07-05 14:45     ` Michael Grzeschik
2014-07-14 13:28       ` Michael Grzeschik
2014-07-14 19:19     ` Brian Norris
2014-07-22 10:09       ` Michael Grzeschik
2014-07-22 19:23         ` Brian Norris
2014-07-22  3:21 ` Brian Norris [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140722032114.GA28323@ld-irv-0074 \
    --to=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=m.grzeschik@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox