]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
mtd: nand: denali: remove unnecessary writes to ECC_CORRECTION
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Wed, 22 Mar 2017 20:07:24 +0000 (05:07 +0900)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Tue, 28 Mar 2017 12:24:46 +0000 (14:24 +0200)
Because SUPPORT_15BITECC is defined, the following is dead code:

  #elif SUPPORT_8BITECC
          iowrite32(8, denali->flash_reg + ECC_CORRECTION);
  #endif

Such ifdefs are useless and unacceptable coding style.

These writes are not needed in the first place since ECC_CORRECTION
is set up by the nand_init() function.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
drivers/mtd/nand/denali.c
drivers/mtd/nand/denali.h

index 1a2e0638affc54bdc834f76df75ba686decc5eef..4ca75d3926efd23e2af54e864eb2df59fa94cf28 100644 (file)
@@ -62,8 +62,6 @@ MODULE_PARM_DESC(onfi_timing_mode,
  */
 #define CHIP_SELECT_INVALID    -1
 
-#define SUPPORT_8BITECC                1
-
 /*
  * This macro divides two integers and rounds fractional values up
  * to the nearest integer value.
@@ -347,14 +345,8 @@ static void get_toshiba_nand_para(struct denali_nand_info *denali)
         * spare area size for some kind of Toshiba NAND device
         */
        if ((ioread32(denali->flash_reg + DEVICE_MAIN_AREA_SIZE) == 4096) &&
-               (ioread32(denali->flash_reg + DEVICE_SPARE_AREA_SIZE) == 64)) {
+               (ioread32(denali->flash_reg + DEVICE_SPARE_AREA_SIZE) == 64))
                iowrite32(216, denali->flash_reg + DEVICE_SPARE_AREA_SIZE);
-#if SUPPORT_15BITECC
-               iowrite32(15, denali->flash_reg + ECC_CORRECTION);
-#elif SUPPORT_8BITECC
-               iowrite32(8, denali->flash_reg + ECC_CORRECTION);
-#endif
-       }
 }
 
 static void get_hynix_nand_para(struct denali_nand_info *denali,
@@ -367,11 +359,6 @@ static void get_hynix_nand_para(struct denali_nand_info *denali,
                iowrite32(4096, denali->flash_reg + DEVICE_MAIN_AREA_SIZE);
                iowrite32(224, denali->flash_reg + DEVICE_SPARE_AREA_SIZE);
                iowrite32(0, denali->flash_reg + DEVICE_WIDTH);
-#if SUPPORT_15BITECC
-               iowrite32(15, denali->flash_reg + ECC_CORRECTION);
-#elif SUPPORT_8BITECC
-               iowrite32(8, denali->flash_reg + ECC_CORRECTION);
-#endif
                break;
        default:
                dev_warn(denali->dev,
index 7b2d7851ed7b55afa4f44e6d76e35475507cdf77..483c0e988f336074f29c74797ff9831378875df4 100644 (file)
 #define CLK_X  5
 #define CLK_MULTI 4
 
-#define SUPPORT_15BITECC        1
-#define SUPPORT_8BITECC         1
-
 #define ONFI_BLOOM_TIME         1
 #define MODE5_WORKAROUND        0