[U-Boot] [PATCH] NAND: Correct the "chip_shift" calculation

s-paulraj at ti.com s-paulraj at ti.com
Fri Nov 6 18:02:11 CET 2009


From: Sandeep Paulraj <s-paulraj at ti.com>

This patch updates the "chip_shift" calculation in the
NAND driver.

Signed-off-by: Sandeep Paulraj <s-paulraj at ti.com>
---
 drivers/mtd/nand/nand_base.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 9237f85..b928cfc 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2714,7 +2714,7 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
 	chip->bbt_erase_shift = chip->phys_erase_shift =
 		ffs(mtd->erasesize) - 1;
 	if (chip->chipsize & 0xffffffff)
-		chip->chip_shift = ffs(chip->chipsize) - 1;
+		chip->chip_shift = ffs((unsigned)chip->chipsize) - 1;
 	else
 		chip->chip_shift = ffs((unsigned)(chip->chipsize >> 32)) + 31;
 
-- 
1.6.0.4



More information about the U-Boot mailing list