1
0
mirror of git://projects.qi-hardware.com/xburst-tools.git synced 2024-11-29 14:37:12 +02:00

remove repeat code

This commit is contained in:
xiangfu 2009-06-24 10:28:10 +00:00
parent 3095ac1f98
commit 54f1305f25

View File

@ -296,42 +296,31 @@ int nand_program_check(struct nand_in *nand_in,
; ;
} }
cur_page = (ret[3] << 24) | (ret[2] << 16) | (ret[1] << 8) |
(ret[0] << 0);
if (nand_in->start < 1 && if (nand_in->start < 1 &&
hand.nand_ps == 4096 && hand.nand_ps == 4096 &&
hand.fw_args.cpu_id == 0x4740) { hand.fw_args.cpu_id == 0x4740) {
/* (nand_out->status)[i] = 1; */ /* (nand_out->status)[i] = 1; */
printf(" no check!"); printf(" no check! End at %d ",cur_page);
cur_page = (ret[3] << 24) |
(ret[2] << 16) |
(ret[1] << 8) |
(ret[0] << 0);
printf(" End at %d ",cur_page);
continue; continue;
} }
if (nand_in->check(nand_in->buf, check_buf, nand_in->length)) { if (nand_in->check(nand_in->buf, check_buf, nand_in->length)) {
/* (nand_out->status)[i] = 1; */ /* (nand_out->status)[i] = 1; */
printf(" pass!"); printf(" pass! End at %d ",cur_page);
cur_page = (ret[3] << 24) |
(ret[2] << 16) |
(ret[1] << 8) |
(ret[0] << 0);
printf(" End at %d ",cur_page);
} else { } else {
/* (nand_out->status)[i] = 0; */ /* (nand_out->status)[i] = 0; */
printf(" fail!"); printf(" fail! End at %d ",cur_page);
struct nand_in bad; struct nand_in bad;
cur_page = (ret[3] << 24) |
(ret[2] << 16) |
(ret[1] << 8) |
(ret[0] << 0);
printf(" End at %d ",cur_page);
bad.start = (cur_page - 1) / hand.nand_ppb; bad.start = (cur_page - 1) / hand.nand_ppb;
if (cur_page % hand.nand_ppb == 0) if (cur_page % hand.nand_ppb == 0)
nand_markbad(&bad); nand_markbad(&bad);
} }
} }
*start_page = cur_page; *start_page = cur_page;
return 0; return 0;
} }