From patchwork Wed Feb 3 20:46:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Rae X-Patchwork-Id: 61152 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp79131lbl; Wed, 3 Feb 2016 12:53:46 -0800 (PST) X-Received: by 10.112.145.193 with SMTP id sw1mr1815576lbb.1.1454532826811; Wed, 03 Feb 2016 12:53:46 -0800 (PST) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id k197si5210073lfb.78.2016.02.03.12.53.46; Wed, 03 Feb 2016 12:53:46 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6DD97A754A; Wed, 3 Feb 2016 21:53:38 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sMs9QgSqw7nQ; Wed, 3 Feb 2016 21:53:38 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2E32CB37D6; Wed, 3 Feb 2016 21:53:35 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 167C9A74F9 for ; Wed, 3 Feb 2016 21:53:26 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 03bVtmDGltK6 for ; Wed, 3 Feb 2016 21:53:26 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-irv-18.localdomain (5520-maca-inet1-outside.broadcom.com [216.31.211.11]) by theia.denx.de (Postfix) with ESMTP id 779A9A74D0 for ; Wed, 3 Feb 2016 21:53:11 +0100 (CET) Received: from mail-irva-13.broadcom.com (mail-irva-13.broadcom.com [10.11.16.103]) by mail-irv-18.localdomain (Postfix) with ESMTP id EECDB82063; Wed, 3 Feb 2016 12:46:06 -0800 (PST) Received: from VM-host64-64-A1.ric.broadcom.com (unknown [10.136.4.105]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id 78DE240FE6; Wed, 3 Feb 2016 12:46:04 -0800 (PST) From: Steve Rae To: u-boot@lists.denx.de Date: Wed, 3 Feb 2016 12:46:01 -0800 Message-Id: <1454532362-31109-1-git-send-email-srae@broadcom.com> X-Mailer: git-send-email 1.8.5 Cc: Steve Rae Subject: [U-Boot] [PATCH 1/2] fastboot: sparse: fix block addressing for don't care chunk type X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" When 7bfc3b1 (sparse: Refactor chunk parsing function) was implemented, it dropped 9981945 (aboot: fix block addressing for don't care chunk type). This re-implements the required fix for the "don't care chunk type"... Signed-off-by: Steve Rae --- common/image-sparse.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -- 1.8.5 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot diff --git a/common/image-sparse.c b/common/image-sparse.c index dffe844..f02aee4 100644 --- a/common/image-sparse.c +++ b/common/image-sparse.c @@ -330,9 +330,11 @@ int store_sparse_image(sparse_storage_t *storage, void *storage_priv, * and go on parsing the rest of the chunks */ if (chunk_header->chunk_type == CHUNK_TYPE_DONT_CARE) { - skipped += sparse_block_size_to_storage(chunk_header->chunk_sz, - storage, - sparse_header); + blkcnt = sparse_block_size_to_storage(chunk_header->chunk_sz, + storage, + sparse_header); + total_blocks += blkcnt; + skipped += blkcnt; continue; } @@ -380,7 +382,7 @@ int store_sparse_image(sparse_storage_t *storage, void *storage_priv, printf("........ wrote %d blocks to '%s'\n", total_blocks, storage->name); - if ((total_blocks + skipped) != + if (total_blocks != sparse_block_size_to_storage(sparse_header->total_blks, storage, sparse_header)) { printf("sparse image write failure\n");