From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Mon, 3 May 2021 17:10:53 -0600 Subject: [PATCH 06/49] image: Update zstd to avoid reporting error twice In-Reply-To: <20210503231136.744283-1-sjg@chromium.org> References: <20210503231136.744283-1-sjg@chromium.org> Message-ID: <20210503171001.6.I2527b4977aee302656ecc6eb5bde18b13f913b78@changeid> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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.31.1.527.g47e6f16901-goog