Skip to content

Commit

Permalink
mtd: nand: denali: remove unnecessary writes to ECC_CORRECTION
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Masahiro Yamada authored and Boris Brezillon committed Mar 28, 2017
1 parent 6652ef8 commit e713ddd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
15 changes: 1 addition & 14 deletions drivers/mtd/nand/denali.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down
3 changes: 0 additions & 3 deletions drivers/mtd/nand/denali.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,6 @@
#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

Expand Down

0 comments on commit e713ddd

Please sign in to comment.