aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/mtdoops.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c
index 5a680e1e61f1..f40e45727aed 100644
--- a/drivers/mtd/mtdoops.c
+++ b/drivers/mtd/mtdoops.c
@@ -99,7 +99,7 @@ static void mtdoops_inc_counter(struct mtdoops_context *cxt)
99 int ret; 99 int ret;
100 100
101 cxt->nextpage++; 101 cxt->nextpage++;
102 if (cxt->nextpage > cxt->oops_pages) 102 if (cxt->nextpage >= cxt->oops_pages)
103 cxt->nextpage = 0; 103 cxt->nextpage = 0;
104 cxt->nextcount++; 104 cxt->nextcount++;
105 if (cxt->nextcount == 0xffffffff) 105 if (cxt->nextcount == 0xffffffff)
@@ -141,7 +141,7 @@ static void mtdoops_workfunc_erase(struct work_struct *work)
141 mod = (cxt->nextpage * OOPS_PAGE_SIZE) % mtd->erasesize; 141 mod = (cxt->nextpage * OOPS_PAGE_SIZE) % mtd->erasesize;
142 if (mod != 0) { 142 if (mod != 0) {
143 cxt->nextpage = cxt->nextpage + ((mtd->erasesize - mod) / OOPS_PAGE_SIZE); 143 cxt->nextpage = cxt->nextpage + ((mtd->erasesize - mod) / OOPS_PAGE_SIZE);
144 if (cxt->nextpage > cxt->oops_pages) 144 if (cxt->nextpage >= cxt->oops_pages)
145 cxt->nextpage = 0; 145 cxt->nextpage = 0;
146 } 146 }
147 147
@@ -158,7 +158,7 @@ badblock:
158 cxt->nextpage * OOPS_PAGE_SIZE); 158 cxt->nextpage * OOPS_PAGE_SIZE);
159 i++; 159 i++;
160 cxt->nextpage = cxt->nextpage + (mtd->erasesize / OOPS_PAGE_SIZE); 160 cxt->nextpage = cxt->nextpage + (mtd->erasesize / OOPS_PAGE_SIZE);
161 if (cxt->nextpage > cxt->oops_pages) 161 if (cxt->nextpage >= cxt->oops_pages)
162 cxt->nextpage = 0; 162 cxt->nextpage = 0;
163 if (i == (cxt->oops_pages / (mtd->erasesize / OOPS_PAGE_SIZE))) { 163 if (i == (cxt->oops_pages / (mtd->erasesize / OOPS_PAGE_SIZE))) {
164 printk(KERN_ERR "mtdoops: All blocks bad!\n"); 164 printk(KERN_ERR "mtdoops: All blocks bad!\n");