diff options
Diffstat (limited to 'drivers/mtd/ubi/vtbl.c')
-rw-r--r-- | drivers/mtd/ubi/vtbl.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c index 1f48c76cf6fe..bc5df50813d6 100644 --- a/drivers/mtd/ubi/vtbl.c +++ b/drivers/mtd/ubi/vtbl.c | |||
@@ -531,7 +531,8 @@ static int init_volumes(struct ubi_device *ubi, const struct ubi_scan_info *si, | |||
531 | if (vol->vol_type == UBI_DYNAMIC_VOLUME) { | 531 | if (vol->vol_type == UBI_DYNAMIC_VOLUME) { |
532 | vol->used_ebs = vol->reserved_pebs; | 532 | vol->used_ebs = vol->reserved_pebs; |
533 | vol->last_eb_bytes = vol->usable_leb_size; | 533 | vol->last_eb_bytes = vol->usable_leb_size; |
534 | vol->used_bytes = vol->used_ebs * vol->usable_leb_size; | 534 | vol->used_bytes = |
535 | (long long)vol->used_ebs * vol->usable_leb_size; | ||
535 | continue; | 536 | continue; |
536 | } | 537 | } |
537 | 538 | ||
@@ -561,7 +562,8 @@ static int init_volumes(struct ubi_device *ubi, const struct ubi_scan_info *si, | |||
561 | } | 562 | } |
562 | 563 | ||
563 | vol->used_ebs = sv->used_ebs; | 564 | vol->used_ebs = sv->used_ebs; |
564 | vol->used_bytes = (vol->used_ebs - 1) * vol->usable_leb_size; | 565 | vol->used_bytes = |
566 | (long long)(vol->used_ebs - 1) * vol->usable_leb_size; | ||
565 | vol->used_bytes += sv->last_data_size; | 567 | vol->used_bytes += sv->last_data_size; |
566 | vol->last_eb_bytes = sv->last_data_size; | 568 | vol->last_eb_bytes = sv->last_data_size; |
567 | } | 569 | } |
@@ -578,7 +580,8 @@ static int init_volumes(struct ubi_device *ubi, const struct ubi_scan_info *si, | |||
578 | vol->usable_leb_size = ubi->leb_size; | 580 | vol->usable_leb_size = ubi->leb_size; |
579 | vol->used_ebs = vol->reserved_pebs; | 581 | vol->used_ebs = vol->reserved_pebs; |
580 | vol->last_eb_bytes = vol->reserved_pebs; | 582 | vol->last_eb_bytes = vol->reserved_pebs; |
581 | vol->used_bytes = vol->used_ebs * (ubi->leb_size - vol->data_pad); | 583 | vol->used_bytes = |
584 | (long long)vol->used_ebs * (ubi->leb_size - vol->data_pad); | ||
582 | vol->vol_id = UBI_LAYOUT_VOL_ID; | 585 | vol->vol_id = UBI_LAYOUT_VOL_ID; |
583 | 586 | ||
584 | ubi_assert(!ubi->volumes[i]); | 587 | ubi_assert(!ubi->volumes[i]); |