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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 3B203C47092 for ; Mon, 31 May 2021 00:20:00 +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 10E1D61241 for ; Mon, 31 May 2021 00:19:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 10E1D61241 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B5E4881664; Mon, 31 May 2021 02:19:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="L8MYIZW8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1CAD481C67; Sun, 30 May 2021 10:56:52 +0200 (CEST) Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) (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 6D48A81660 for ; Sun, 30 May 2021 10:56:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=liu.ming50@gmail.com Received: by mail-lj1-x234.google.com with SMTP id s25so10880580ljo.11 for ; Sun, 30 May 2021 01:56:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yF10T1un/KZQW6woSWqGuy1mX4kFECkAeSrxLlc4k9Y=; b=L8MYIZW859ZlXQ8kTBfhuG76EkIJJmZz8AO+dnbBzTJqdPIp+Zb3ZfqZZXjGHowW4q 5VrpGOM9BiWF1zdPNF+Pi8OSdTXCLxatJ7gdaLeRURh9GEKipZvAVyymyVL+tozxdLKQ 5Bj9StvRzlkRTfBwdL3z2kiMVMACGvfK14MQfCyOrFEIrB+KNAhetq3slHn9Cd2ittZd vH8OJfRb1uMOUVIFTPAZ0Fiv1YzTuPQAJj4uFHij1r8xz7ySe3c1oZCs5Vb/UvsLHGhl SgLIYXD2ujmpnQ3BsBsXxTmOAekFee/Ke8tZrLDFtFLaQp+PgZ/Yi/Vc8h+iiC6BuzB0 S+Sw== 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:mime-version :content-transfer-encoding; bh=yF10T1un/KZQW6woSWqGuy1mX4kFECkAeSrxLlc4k9Y=; b=BY/8Vjiu4H04Rq7nkJx7zwXU9Tk+tAW26OxjoERDChJ564sY4nEr7jr7wzRoVPInz1 uZdKwUc6Hv9DM+ufA2+K/Nkz9T32ck4N3GefB/NYBK6TVV0W6ZCOQ16/3YH08u3bG+BZ 4Qc1Y3winPn3rqvEz3f+mHKoLu2JzPTJ+K0PSUBh7yjxJftLNYLxkVlVA6nEkCNyPvcg LkRADwM/N/Yupwk0DmYlYy+82aVL9qrqjO/iuP0croNtZXwtAQh2gtGGB1E1/KvS+hKn R6NIELwHfSNkpWmuiwd9qxqBTBE2Cto+kCFNGxd+zmxl06cQK+BkQDoSbxWujpLTmA+1 cqvA== X-Gm-Message-State: AOAM533ptxW2TNnA3iw1u6fLF3EDWL315Z4QHdypTg309vj+rjuXtT5g K0KMODsuvtTU/uEbiZod8J6RF/Wh7k0= X-Google-Smtp-Source: ABdhPJz2g93NfKVEX99GvQqwS91EOtWrO22E3vKe1LuFQXhcY277lXAOiWVG0wrZGfVMyxGwe8LPSg== X-Received: by 2002:a05:651c:550:: with SMTP id q16mr12393541ljp.433.1622365008661; Sun, 30 May 2021 01:56:48 -0700 (PDT) Received: from localhost.localdomain (m83-185-32-234.cust.tele2.se. [83.185.32.234]) by smtp.gmail.com with ESMTPSA id h25sm960822lfe.268.2021.05.30.01.56.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 May 2021 01:56:48 -0700 (PDT) From: liu.ming50@gmail.com To: u-boot@lists.denx.de Cc: sergio.prado@toradex.com, max.krummenacher@toradex.com, Ming Liu Subject: [[PATCH] tools: image-host: fix wrong return value Date: Sun, 30 May 2021 10:56:39 +0200 Message-Id: <20210530085639.715268-1-liu.ming50@gmail.com> X-Mailer: git-send-email 2.29.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Mon, 31 May 2021 02:19:54 +0200 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.102.4 at phobos.denx.de X-Virus-Status: Clean From: Ming Liu The return value '-ENOSPC' of fit_set_timestamp function does not match the caller fit_image_write_sig's expection which is '-FDT_ERR_NOSPACE'. Fix it by not calling fit_set_timestamp, but call fdt_setprop instead. This fixes a following mkimage error: | Can't write signature for 'signature@1' signature node in | 'conf@imx6ull-colibri-wifi-eval-v3.dtb' conf node: | mkimage Can't add hashes to FIT blob: -1 Signed-off-by: Ming Liu --- tools/image-host.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/image-host.c b/tools/image-host.c index 270d36fe45..73095461a7 100644 --- a/tools/image-host.c +++ b/tools/image-host.c @@ -132,8 +132,10 @@ static int fit_image_write_sig(void *fit, int noffset, uint8_t *value, if (!ret) { time_t timestamp = imagetool_get_source_date(cmdname, time(NULL)); + uint32_t t = cpu_to_uimage(timestamp); - ret = fit_set_timestamp(fit, noffset, timestamp); + ret = fdt_setprop(fit, noffset, FIT_TIMESTAMP_PROP, &t, + sizeof(uint32_t)); } if (region_prop && !ret) { uint32_t strdata[2]; -- 2.29.0