From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.x-arc.co.uk ([217.6.246.34] helo=root.phytec.de) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1b6CTY-0004yU-Ld for barebox@lists.infradead.org; Fri, 27 May 2016 07:46:35 +0000 Received: from idefix.phytec.de (idefix.phytec.de [172.16.0.10]) by root.phytec.de (Postfix) with ESMTP id 8685CA00B50 for ; Fri, 27 May 2016 09:46:41 +0200 (CEST) From: Teresa Remmet Date: Fri, 27 May 2016 09:44:40 +0200 Message-Id: <1464335095-35180-48-git-send-email-t.remmet@phytec.de> In-Reply-To: <1464335095-35180-1-git-send-email-t.remmet@phytec.de> References: <1464335095-35180-1-git-send-email-t.remmet@phytec.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH v2 47/62] UBI: Init vol->reserved_pebs by assignment To: barebox@lists.infradead.org From: shengyong `vol' is a newly allocated value by kzalloc. Initialize it by assignment instead of `+='. Signed-off-by: Sheng Yong Signed-off-by: Richard Weinberger Signed-off-by: Teresa Remmet --- 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 fbe8876..41b814c 100644 --- a/drivers/mtd/ubi/vmt.c +++ b/drivers/mtd/ubi/vmt.c @@ -89,8 +89,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.9.1 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox