diff options
Diffstat (limited to 'drivers/mtd/tests/subpagetest.c')
-rw-r--r-- | drivers/mtd/tests/subpagetest.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/mtd/tests/subpagetest.c b/drivers/mtd/tests/subpagetest.c index a876371ad410..7b59ef522d5e 100644 --- a/drivers/mtd/tests/subpagetest.c +++ b/drivers/mtd/tests/subpagetest.c | |||
@@ -57,7 +57,7 @@ static int write_eraseblock(int ebnum) | |||
57 | { | 57 | { |
58 | size_t written; | 58 | size_t written; |
59 | int err = 0; | 59 | int err = 0; |
60 | loff_t addr = ebnum * mtd->erasesize; | 60 | loff_t addr = (loff_t)ebnum * mtd->erasesize; |
61 | 61 | ||
62 | prandom_bytes_state(&rnd_state, writebuf, subpgsize); | 62 | prandom_bytes_state(&rnd_state, writebuf, subpgsize); |
63 | err = mtd_write(mtd, addr, subpgsize, &written, writebuf); | 63 | err = mtd_write(mtd, addr, subpgsize, &written, writebuf); |
@@ -92,7 +92,7 @@ static int write_eraseblock2(int ebnum) | |||
92 | { | 92 | { |
93 | size_t written; | 93 | size_t written; |
94 | int err = 0, k; | 94 | int err = 0, k; |
95 | loff_t addr = ebnum * mtd->erasesize; | 95 | loff_t addr = (loff_t)ebnum * mtd->erasesize; |
96 | 96 | ||
97 | for (k = 1; k < 33; ++k) { | 97 | for (k = 1; k < 33; ++k) { |
98 | if (addr + (subpgsize * k) > (ebnum + 1) * mtd->erasesize) | 98 | if (addr + (subpgsize * k) > (ebnum + 1) * mtd->erasesize) |
@@ -131,7 +131,7 @@ static int verify_eraseblock(int ebnum) | |||
131 | { | 131 | { |
132 | size_t read; | 132 | size_t read; |
133 | int err = 0; | 133 | int err = 0; |
134 | loff_t addr = ebnum * mtd->erasesize; | 134 | loff_t addr = (loff_t)ebnum * mtd->erasesize; |
135 | 135 | ||
136 | prandom_bytes_state(&rnd_state, writebuf, subpgsize); | 136 | prandom_bytes_state(&rnd_state, writebuf, subpgsize); |
137 | clear_data(readbuf, subpgsize); | 137 | clear_data(readbuf, subpgsize); |
@@ -192,7 +192,7 @@ static int verify_eraseblock2(int ebnum) | |||
192 | { | 192 | { |
193 | size_t read; | 193 | size_t read; |
194 | int err = 0, k; | 194 | int err = 0, k; |
195 | loff_t addr = ebnum * mtd->erasesize; | 195 | loff_t addr = (loff_t)ebnum * mtd->erasesize; |
196 | 196 | ||
197 | for (k = 1; k < 33; ++k) { | 197 | for (k = 1; k < 33; ++k) { |
198 | if (addr + (subpgsize * k) > (ebnum + 1) * mtd->erasesize) | 198 | if (addr + (subpgsize * k) > (ebnum + 1) * mtd->erasesize) |
@@ -227,7 +227,7 @@ static int verify_eraseblock_ff(int ebnum) | |||
227 | uint32_t j; | 227 | uint32_t j; |
228 | size_t read; | 228 | size_t read; |
229 | int err = 0; | 229 | int err = 0; |
230 | loff_t addr = ebnum * mtd->erasesize; | 230 | loff_t addr = (loff_t)ebnum * mtd->erasesize; |
231 | 231 | ||
232 | memset(writebuf, 0xff, subpgsize); | 232 | memset(writebuf, 0xff, subpgsize); |
233 | for (j = 0; j < mtd->erasesize / subpgsize; ++j) { | 233 | for (j = 0; j < mtd->erasesize / subpgsize; ++j) { |