From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79E29C4338F for ; Sun, 1 Aug 2021 21:02:23 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F104B60F55 for ; Sun, 1 Aug 2021 21:02:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org F104B60F55 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3BAC783333; Sun, 1 Aug 2021 23:01:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="V5WZPNQ9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 25F2283311; Sun, 1 Aug 2021 23:00:54 +0200 (CEST) Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C1C8583307 for ; Sun, 1 Aug 2021 23:00:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-ot1-x32e.google.com with SMTP id 19-20020a9d08930000b02904b98d90c82cso15681326otf.5 for ; Sun, 01 Aug 2021 14:00:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=00PrgY5Bu0ncdnCUs9EJlRYfaziWtoI7CgnUhq+Azr0=; b=V5WZPNQ9TxK+vGfUvAK0+iqVAxRumG+hDpqVq5+Yc1hYJhtK5YOjK9uWfcPBOQWXiK nXr8S1Feczxobv3PF0hfAcFVI+yJDaVPfJY+uPLcdkphhvvuaNQ3W60nKcbFzLOSh8bv zltAxLmnLPr0XmCqsXYvwhr62uICqQr+zeCRY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=00PrgY5Bu0ncdnCUs9EJlRYfaziWtoI7CgnUhq+Azr0=; b=GpBswJnOE1mTSuLMipLlitKpH9hq8M9JnHoKnP8ydhhCHxF7C7j4+IXt9XHKXd1De0 rncqgXf2rrMf7E6WUJjBY0Z+rc8uJiDTTOMdNwLrX+HsBhSnguxtEyv0yPbwDx60BXVb ypY9qbJ2P3xR2ZBpcIeLSuK4lO06lfksHFNibvFCW0+6i8eA9f/2WDVCMr4t/b+b6GWI 4uT6tuYvXDzuefCYYODwJjKeFcgoltSTZbdgwq4bbBXO5cJfcOEV1JigcQjlSfp5nZOA Gwi1XlMxSJ90Om4QlpScJSC4FcNqvWng8/8A+bEIDu4RA5VnRk+QDBBkm2eC/iAM8CiY khzg== X-Gm-Message-State: AOAM530bSCxBh7Pot1O15FGl44vGjiUH1lUvoiSQMmXkFwzmCElsATvS N6YazHBSAMp/8Xstum3PPD8eAL7/b7DvS11J X-Google-Smtp-Source: ABdhPJxGoO3euvJxLR8pea17np7TzAmwiXZdafipWfGpPy/0nEn/Ho87jDY216HPivoz/MI4IC+pKw== X-Received: by 2002:a9d:7608:: with SMTP id k8mr1029553otl.239.1627851647310; Sun, 01 Aug 2021 14:00:47 -0700 (PDT) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id s16sm1560707otg.51.2021.08.01.14.00.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Aug 2021 14:00:46 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Bin Meng , Tom Rini , Alexandru Gagniuc , Simon Glass , Joe Hershberger , Marek Vasut Subject: [PATCH v3 07/15] image: Update zstd to avoid reporting error twice Date: Sun, 1 Aug 2021 15:00:24 -0600 Message-Id: <20210801150024.v3.7.I2527b4977aee302656ecc6eb5bde18b13f913b78@changeid> X-Mailer: git-send-email 2.32.0.554.ge1b32706d8-goog In-Reply-To: <20210801210032.2203104-1-sjg@chromium.org> References: <20210801210032.2203104-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean The zstd implementation prints the error in image_decomp() which is incorrect and does not match other algorithms. Drop this and let the caller report the error. Signed-off-by: Simon Glass --- (no changes since v1) common/image.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/common/image.c b/common/image.c index 6c38211efce..bd71bf7ec29 100644 --- a/common/image.c +++ b/common/image.c @@ -532,12 +532,10 @@ int image_decomp(int comp, ulong load, ulong image_start, int type, abuf_init_set(&in, image_buf, image_len); abuf_init_set(&in, load_buf, unc_len); ret = zstd_decompress(&in, &out); - if (ret < 0) { - printf("ZSTD decompression failed\n"); - return ret; + if (ret >= 0) { + image_len = ret; + ret = 0; } - - image_len = ret; break; } #endif /* CONFIG_ZSTD */ -- 2.32.0.554.ge1b32706d8-goog