NAND Boot: fix an invalid PC error caused by div operation.
authorAlex Ling <ling_kasim@yahoo.cn>
Sun, 4 Oct 2009 07:58:43 +0000 (4 15:58 +0800)
committerMichel Pollet <buserror@gmail.com>
Wed, 7 Oct 2009 09:49:01 +0000 (7 10:49 +0100)
Signed-off-by: Michel Pollet <buserror@gmail.com>
cpu/arm920t/s3c24x0/nand_read.c

index 288a0b2..753bab5 100644 (file)
@@ -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 */