public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v1 6/6] mtd: nand: omap_gpmc: minor cleanup of omap_correct_data_bch
Date: Thu, 10 Apr 2014 13:18:04 +0200	[thread overview]
Message-ID: <53467DEC.20504@denx.de> (raw)
In-Reply-To: <1397122543-30074-7-git-send-email-pekon@ti.com>

On 10.04.2014 11:35, Pekon Gupta wrote:
> This patch tries to avoid some local pointer dereferences, by using common
> local variables in omap_correct_data_bch()
>
> Signed-off-by: Pekon Gupta <pekon@ti.com>
> ---
>   drivers/mtd/nand/omap_gpmc.c | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/mtd/nand/omap_gpmc.c b/drivers/mtd/nand/omap_gpmc.c
> index ae541c2..a96f310 100644
> --- a/drivers/mtd/nand/omap_gpmc.c
> +++ b/drivers/mtd/nand/omap_gpmc.c
> @@ -331,7 +331,7 @@ static int omap_correct_data_bch(struct mtd_info *mtd, uint8_t *dat,
>   {
>   	struct nand_chip *chip = mtd->priv;
>   	struct omap_nand_info	*info = chip->priv;
> -	uint32_t eccbytes = chip->ecc.bytes;
> +	struct nand_ecc_ctrl	*ecc = &chip->ecc;

Again, nitpicking because of inconsistent indentation.

>   	uint32_t error_count = 0, error_max;
>   	uint32_t error_loc[8];
>   	enum bch_level bch_type;
> @@ -340,7 +340,7 @@ static int omap_correct_data_bch(struct mtd_info *mtd, uint8_t *dat,
>   	uint32_t byte_pos, bit_pos;
>
>   	/* check calculated ecc */
> -	for (i = 0; i < chip->ecc.bytes && !ecc_flag; i++) {
> +	for (i = 0; i < ecc->bytes && !ecc_flag; i++) {
>   		if (calc_ecc[i] != 0x00)
>   			ecc_flag = 1;
>   	}
> @@ -349,7 +349,7 @@ static int omap_correct_data_bch(struct mtd_info *mtd, uint8_t *dat,
>
>   	/* check for whether its a erased-page */
>   	ecc_flag = 0;
> -	for (i = 0; i < chip->ecc.bytes && !ecc_flag; i++) {
> +	for (i = 0; i < ecc->bytes && !ecc_flag; i++) {
>   		if (read_ecc[i] != 0xff)
>   			ecc_flag = 1;
>   	}
> @@ -363,7 +363,7 @@ static int omap_correct_data_bch(struct mtd_info *mtd, uint8_t *dat,
>   	switch (info->ecc_scheme) {
>   	case OMAP_ECC_BCH8_CODE_HW:
>   		bch_type = BCH_8_BIT;
> -		omap_reverse_list(calc_ecc, eccbytes - 1);
> +		omap_reverse_list(calc_ecc, ecc->bytes - 1);
>   		break;
>   	default:
>   		return -EINVAL;
> @@ -372,14 +372,14 @@ static int omap_correct_data_bch(struct mtd_info *mtd, uint8_t *dat,
>   	elm_config(bch_type);
>   	if (elm_check_error(calc_ecc, bch_type, &error_count, error_loc)) {
>   		printf("nand: error: uncorrectable ECC errors\n");
> -		return -EINVAL;
> +		return -EBADMSG;

This change is not mentioned in the commit log. Is it intentional? Or 
should it be moved to a separate patch?

Thanks,
Stefan

      reply	other threads:[~2014-04-10 11:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-10  9:35 [U-Boot] [PATCH v1 0/6] mtd: nand: omap: clean up of omap_elm and omap_gpmc driver Pekon Gupta
2014-04-10  9:35 ` [U-Boot] [PATCH v1 1/6] mtd: nand: omap_elm: remove #include omap_gpmc.h Pekon Gupta
2014-04-10 10:56   ` Stefan Roese
2014-04-10  9:35 ` [U-Boot] [PATCH v1 2/6] mtd: nand: omap_elm: use bch_type instead of nibble count to differentiate between BCH4/BCH8/BCH16 Pekon Gupta
2014-04-10 11:00   ` Stefan Roese
2014-04-10 11:07     ` Gupta, Pekon
2014-04-10  9:35 ` [U-Boot] [PATCH v1 3/6] mtd: nand: omap_elm: use macros for register definitions Pekon Gupta
2014-04-10 11:00   ` Stefan Roese
2014-04-10  9:35 ` [U-Boot] [PATCH v1 4/6] mtd: nand: omap_gpmc: remove unused members of 'struct nand_bch_priv' Pekon Gupta
2014-04-10 11:01   ` Stefan Roese
2014-04-10  9:35 ` [U-Boot] [PATCH v1 5/6] mtd: nand: omap_gpmc: rename struct nand_bch_priv to struct omap_nand_info Pekon Gupta
2014-04-10 11:05   ` Stefan Roese
2014-04-10  9:35 ` [U-Boot] [PATCH v1 6/6] mtd: nand: omap_gpmc: minor cleanup of omap_correct_data_bch Pekon Gupta
2014-04-10 11:18   ` Stefan Roese [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=53467DEC.20504@denx.de \
    --to=sr@denx.de \
    --cc=u-boot@lists.denx.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