From: Alex Ling Date: Sun, 4 Oct 2009 07:58:43 +0000 (+0800) Subject: NAND Boot: fix an invalid PC error caused by div operation. X-Git-Url: https://repo.or.cz/w/u-boot-openmoko/mini2440.git/commitdiff_plain/9aa5deff3514140a651b22e0f678be25dcff9988 NAND Boot: fix an invalid PC error caused by div operation. Signed-off-by: Michel Pollet --- diff --git a/cpu/arm920t/s3c24x0/nand_read.c b/cpu/arm920t/s3c24x0/nand_read.c index 288a0b24..753bab5d 100644 --- a/cpu/arm920t/s3c24x0/nand_read.c +++ b/cpu/arm920t/s3c24x0/nand_read.c @@ -210,7 +210,7 @@ int nand_read_ll(unsigned char *buf, unsigned long start_addr, int size) for (i=start_addr; i < (start_addr + size);) { #ifdef CONFIG_S3C2410_NAND_SKIP_BAD - if (i % nand.block_size == 0) { + if (i & (nand.block_size-1)== 0) { if (is_bad_block(&nand, i) || is_bad_block(&nand, i + nand.page_size)) { /* Bad block */