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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6E0DC433EF for ; Sat, 25 Sep 2021 13:05:26 +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 31161610CF for ; Sat, 25 Sep 2021 13:05:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 31161610CF 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 E64A383539; Sat, 25 Sep 2021 15:04:35 +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="Lc0c+CCw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 228068351C; Sat, 25 Sep 2021 15:04:05 +0200 (CEST) Received: from mail-oi1-x236.google.com (mail-oi1-x236.google.com [IPv6:2607:f8b0:4864:20::236]) (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 1D18983529 for ; Sat, 25 Sep 2021 15:03:47 +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-oi1-x236.google.com with SMTP id s69so18511827oie.13 for ; Sat, 25 Sep 2021 06:03:47 -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=ka8rfjJR6OU58rv/3CUacvk1ROtvld6M4SjDoBjTKPE=; b=Lc0c+CCw+R1B92ZwBqp/axIYQXQywi5h2plTp0VnE/eFo/It622pG79y+wxDK6TPU7 YoSaVlqxtVeE3Grf7Mgmhvuf/JWquLMvW6/3OAYqUBZitKOZk+KLCcUguXJ/L1gE9bpj +y0rRIGf+AKaPEyq422yJQ6hawn1r9A3iiu5c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ka8rfjJR6OU58rv/3CUacvk1ROtvld6M4SjDoBjTKPE=; b=crVWCGeEZ9eJ5uKOz8g3AiiGzbqDJOrLYxqGW1tu0J+wMYc3h98HtcFYNv7ICzr1nt GuJTCFHBaI1mn5xMyvakawbH/TCozMoKKugV+/891cKbfb0FY/tq7/r1quPbFLxxN81r Jmg00v5lU95L6gjZXajg1H3gq03VZIWlLCQNWyE1qMGPJmzkew7lZSCY49r1K/1GTBnK pEFrrSXD9pVuGrDL9YxsoO+0wmJkBrlwTdwdZBsPBJyEH+NbGQHnX+ZdAy3DO61F7aqi /3KXtf/n2XcT50YSfvKjvej1dLObxUC/OJ2sOmf6gGBeF7TSQYXcmETRHTj2HS3stYjF Lwcw== X-Gm-Message-State: AOAM530IEIuatw9kBQ/xPDU7GmbNzZWImEcVC95raUczYIZFqvrlrNwu BaWXaJZOElRBFN4O6DXMBMNUrnb4inaq+w== X-Google-Smtp-Source: ABdhPJxBSUtWgZVRP5ThYaKpZQfXfWRy+SL3GftvDjzQzK2K8kEUKGCts42bjIoSGGX2a/RVHsNt0w== X-Received: by 2002:aca:a984:: with SMTP id s126mr5346583oie.150.1632575025223; Sat, 25 Sep 2021 06:03:45 -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 f61sm2770018otf.73.2021.09.25.06.03.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 06:03:44 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Alexandru Gagniuc , Bin Meng , Tom Rini , Simon Glass , Joe Hershberger , Marek Vasut Subject: [PATCH v4 07/15] image: Update zstd to avoid reporting error twice Date: Sat, 25 Sep 2021 07:03:12 -0600 Message-Id: <20210925070255.v4.7.I2527b4977aee302656ecc6eb5bde18b13f913b78@changeid> X-Mailer: git-send-email 2.33.0.685.g46640cef36-goog In-Reply-To: <20210925130320.7824-1-sjg@chromium.org> References: <20210925130320.7824-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 d80781f2eb4..7fd4a567626 100644 --- a/common/image.c +++ b/common/image.c @@ -534,12 +534,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.33.0.685.g46640cef36-goog