diff --git a/cmd/mtd.c b/cmd/mtd.c index e63c011e791..9083a6840ac 100644 --- a/cmd/mtd.c +++ b/cmd/mtd.c @@ -77,7 +77,7 @@ static void mtd_dump_device_buf(struct mtd_info *mtd, u64 start_off, if (has_pages) { for (page = 0; page < npages; page++) { - u64 data_off = page * mtd->writesize; + u64 data_off = (u64)page * mtd->writesize; printf("\nDump %d data bytes from 0x%08llx:\n", mtd->writesize, start_off + data_off); @@ -85,7 +85,7 @@ static void mtd_dump_device_buf(struct mtd_info *mtd, u64 start_off, mtd->writesize, start_off + data_off); if (woob) { - u64 oob_off = page * mtd->oobsize; + u64 oob_off = (u64)page * mtd->oobsize; printf("Dump %d OOB bytes from page at 0x%08llx:\n", mtd->oobsize, start_off + data_off);