[RFC PATCH v2 4/6] UBI: Init vol->reserved_pebs by assignment
Sheng Yong
shengyong1 at huawei.com
Tue May 26 03:07:08 PDT 2015
`vol' is a newly allocated value by kzalloc. Initialize it by assignment
instead of `+='.
Signed-off-by: Sheng Yong <shengyong1 at huawei.com>
---
drivers/mtd/ubi/vmt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c
index ff4d978..da2264b 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) {
--
1.8.3.4
More information about the linux-mtd
mailing list