diff mbox

[U-Boot] mtd: nand: omap_gpmc: cosmetic: Fix indentation

Message ID 1386226686-4209-1-git-send-email-sr@denx.de
State Accepted
Delegated to: Scott Wood
Headers show

Commit Message

Stefan Roese Dec. 5, 2013, 6:58 a.m. UTC
Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Pekon Gupta <pekon@ti.com>
Cc: Scott Wood <scottwood@freescale.com>
---
 drivers/mtd/nand/omap_gpmc.c | 86 ++++++++++++++++++++++----------------------
 1 file changed, 43 insertions(+), 43 deletions(-)

Comments

pekon gupta Dec. 5, 2013, 7:05 a.m. UTC | #1
Hi Stefan,

>From: Stefan Roese [mailto:sr@denx.de]
>Subject: [PATCH] mtd: nand: omap_gpmc: cosmetic: Fix indentation
>
>Signed-off-by: Stefan Roese <sr@denx.de>
>Cc: Pekon Gupta <pekon@ti.com>
>Cc: Scott Wood <scottwood@freescale.com>
>---
> drivers/mtd/nand/omap_gpmc.c | 86 ++++++++++++++++++++++----------------------
> 1 file changed, 43 insertions(+), 43 deletions(-)
>
>diff --git a/drivers/mtd/nand/omap_gpmc.c b/drivers/mtd/nand/omap_gpmc.c
>index 5e7e6b3..407b2e5 100644
>--- a/drivers/mtd/nand/omap_gpmc.c
>+++ b/drivers/mtd/nand/omap_gpmc.c
>@@ -283,53 +283,53 @@ static void omap_hwecc_init_bch(struct nand_chip *chip, int32_t mode)
>
There is already a patch-set which cleans much more, apart from
these changes.
http://lists.denx.de/pipermail/u-boot/2013-November/167445.html

Above patch-set does not change the functionality, just optimizes
some data-paths which should help in:
- reducing NAND boot time.
- make driver scalable to add stronger ecc-schemes in future.

As you are actively working on mainline u-boot.
It would be helpful if you can test/ack above patch-set, as its still
not merged.


with regards, pekon
Stefan Roese Dec. 5, 2013, 7:31 a.m. UTC | #2
Hi Pekon,

On 05.12.2013 08:05, Gupta, Pekon wrote:
>> diff --git a/drivers/mtd/nand/omap_gpmc.c b/drivers/mtd/nand/omap_gpmc.c
>> index 5e7e6b3..407b2e5 100644
>> --- a/drivers/mtd/nand/omap_gpmc.c
>> +++ b/drivers/mtd/nand/omap_gpmc.c
>> @@ -283,53 +283,53 @@ static void omap_hwecc_init_bch(struct nand_chip *chip, int32_t mode)
>>
> There is already a patch-set which cleans much more, apart from
> these changes.
> http://lists.denx.de/pipermail/u-boot/2013-November/167445.html

Ah, I missed this.

> Above patch-set does not change the functionality, just optimizes
> some data-paths which should help in:
> - reducing NAND boot time.
> - make driver scalable to add stronger ecc-schemes in future.
> 
> As you are actively working on mainline u-boot.
> It would be helpful if you can test/ack above patch-set, as its still
> not merged.

I'll try to find some time to do this tomorrow. Please send also this
8bit NAND fixup patch so that I can add it to the test as well.

Thanks,
Stefan
Scott Wood Dec. 17, 2013, 11:39 p.m. UTC | #3
On Thu, Dec 05, 2013 at 07:58:06AM +0100, Stefan Roese wrote:
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Pekon Gupta <pekon@ti.com>
> Cc: Scott Wood <scottwood@freescale.com>
> 
> ---
> drivers/mtd/nand/omap_gpmc.c | 86 ++++++++++++++++++++++----------------------
>  1 file changed, 43 insertions(+), 43 deletions(-)

Applied to u-boot-nand-flash.git with long lines wrapped.

I'm applying this even though the "optimize OMAP NAND driver" patchset
addresses the indentation, because it's too late in the release cycle for
that patchset (rc2 is already out, and v9 of the patchset was posted 10
days after the merge window closed) and the misindentation isn't just
ugly, but misleading as to the code flow (when I applied the patch that
introduced this, I thought Pekon had fixed it in the last version
posted).  I didn't want to let this significant readability regression
into the release.

Plus, this keeps the history cleaner than if the indentation fix were
combined with other changes.

-Scott
diff mbox

Patch

diff --git a/drivers/mtd/nand/omap_gpmc.c b/drivers/mtd/nand/omap_gpmc.c
index 5e7e6b3..407b2e5 100644
--- a/drivers/mtd/nand/omap_gpmc.c
+++ b/drivers/mtd/nand/omap_gpmc.c
@@ -283,53 +283,53 @@  static void omap_hwecc_init_bch(struct nand_chip *chip, int32_t mode)
 	if (bch->ecc_scheme == OMAP_ECC_BCH8_CODE_HW) {
 		wr_mode = BCH_WRAPMODE_1;
 
-	switch (bch->nibbles) {
-	case ECC_BCH4_NIBBLES:
-		unused_length = 3;
-		break;
-	case ECC_BCH8_NIBBLES:
-		unused_length = 2;
-		break;
-	case ECC_BCH16_NIBBLES:
-		unused_length = 0;
-		break;
-	}
-
-	/*
-	 * This is ecc_size_config for ELM mode.
-	 * Here we are using different settings for read and write access and
-	 * also depending on BCH strength.
-	 */
-	switch (mode) {
-	case NAND_ECC_WRITE:
-		/* write access only setup eccsize1 config */
-		val = ((unused_length + bch->nibbles) << 22);
-		break;
+		switch (bch->nibbles) {
+		case ECC_BCH4_NIBBLES:
+			unused_length = 3;
+			break;
+		case ECC_BCH8_NIBBLES:
+			unused_length = 2;
+			break;
+		case ECC_BCH16_NIBBLES:
+			unused_length = 0;
+			break;
+		}
 
-	case NAND_ECC_READ:
-	default:
 		/*
-		 * by default eccsize0 selected for ecc1resultsize
-		 * eccsize0 config.
+		 * This is ecc_size_config for ELM mode.
+		 * Here we are using different settings for read and write access and
+		 * also depending on BCH strength.
 		 */
-		val  = (bch->nibbles << 12);
-		/* eccsize1 config */
-		val |= (unused_length << 22);
-		break;
-	}
+		switch (mode) {
+		case NAND_ECC_WRITE:
+			/* write access only setup eccsize1 config */
+			val = ((unused_length + bch->nibbles) << 22);
+			break;
+
+		case NAND_ECC_READ:
+		default:
+			/*
+			 * by default eccsize0 selected for ecc1resultsize
+			 * eccsize0 config.
+			 */
+			val  = (bch->nibbles << 12);
+			/* eccsize1 config */
+			val |= (unused_length << 22);
+			break;
+		}
 	} else {
-	/*
-	 * This ecc_size_config setting is for BCH sw library.
-	 *
-	 * Note: we only support BCH8 currently with BCH sw library!
-	 * Should be really easy to adobt to BCH4, however some omap3 have
-	 * flaws with BCH4.
-	 *
-	 * Here we are using wrapping mode 6 both for reading and writing, with:
-	 *  size0 = 0  (no additional protected byte in spare area)
-	 *  size1 = 32 (skip 32 nibbles = 16 bytes per sector in spare area)
-	 */
-	val = (32 << 22) | (0 << 12);
+		/*
+		 * This ecc_size_config setting is for BCH sw library.
+		 *
+		 * Note: we only support BCH8 currently with BCH sw library!
+		 * Should be really easy to adobt to BCH4, however some omap3 have
+		 * flaws with BCH4.
+		 *
+		 * Here we are using wrapping mode 6 both for reading and writing, with:
+		 *  size0 = 0  (no additional protected byte in spare area)
+		 *  size1 = 32 (skip 32 nibbles = 16 bytes per sector in spare area)
+		 */
+		val = (32 << 22) | (0 << 12);
 	}
 	/* ecc size configuration */
 	writel(val, &gpmc_cfg->ecc_size_config);