summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorshengyong <shengyong1@huawei.com>2015-05-26 12:07:08 +0200
committerRichard Weinberger <richard@nod.at>2015-06-02 11:44:43 +0200
commite8d266cf8d24e52eac65bdab24afd6f4cfc0ad07 (patch)
treef12cbdf3c55d777162c9cb323547cb528b29239f /drivers/mtd
parentUBI: Fastmap: Rename variables to make them meaningful (diff)
downloadlinux-e8d266cf8d24e52eac65bdab24afd6f4cfc0ad07.tar.xz
linux-e8d266cf8d24e52eac65bdab24afd6f4cfc0ad07.zip
UBI: Init vol->reserved_pebs by assignment
`vol' is a newly allocated value by kzalloc. Initialize it by assignment instead of `+='. Signed-off-by: Sheng Yong <shengyong1@huawei.com> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/ubi/vmt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c
index ff4d97848d1c..da2264b4faca 100644
--- a/drivers/mtd/ubi/vmt.c
+++ b/drivers/mtd/ubi/vmt.c
@@ -253,8 +253,8 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req)
/* Calculate how many eraseblocks are requested */
vol->usable_leb_size = ubi->leb_size - ubi->leb_size % req->alignment;
- vol->reserved_pebs += div_u64(req->bytes + vol->usable_leb_size - 1,
- vol->usable_leb_size);
+ vol->reserved_pebs = div_u64(req->bytes + vol->usable_leb_size - 1,
+ vol->usable_leb_size);
/* Reserve physical eraseblocks */
if (vol->reserved_pebs > ubi->avail_pebs) {