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 6E88FC04FF3 for ; Mon, 24 May 2021 20:21:11 +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 98E2E61057 for ; Mon, 24 May 2021 20:21:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 98E2E61057 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 743CE82EEB; Mon, 24 May 2021 22:20:11 +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="kO61z2n/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6A4C682ED6; Mon, 24 May 2021 22:19:52 +0200 (CEST) Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) (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 B5B9D82C95 for ; Mon, 24 May 2021 22:19:47 +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=mr.nuke.me@gmail.com Received: by mail-oi1-x22a.google.com with SMTP id z3so28177867oib.5 for ; Mon, 24 May 2021 13:19:47 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=aD288f9s1pGlTISDsK/I9O7Xr4z5+5zQ5h/of+pFDZA=; b=kO61z2n/I1abqCiFp9PIncvnnv7vtqY6jkq+P/UmPfdUIzUmBZmQddIVj8Ze+4WfgD hjZKSAWa2zEfeCjAS/NHQXdCS2pUmOqcIG+/yPQ6NB2oB4YyP3dpgEiI9eKLqb/EO4/V F5x78KRbenoKWu4dSuRKDI9vmLwKGPozYke88CLqF2746UWDzSebaDENb74OIeTEggB3 eqFjKAwcs42po6FOeKJZM9Iv1q6IggNpcLb3eV40umDsrgFRcjS4Yn0Kl8fqwG7STuug OmicGJOt9qD2ESQzG6bRSCJ5UC0JthnR5CuPQ7qYOOSwis3P4HJFYnTFJFOQCtnFFJSa czmg== 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=aD288f9s1pGlTISDsK/I9O7Xr4z5+5zQ5h/of+pFDZA=; b=Xds/mn8XbMPbKZAGh8cmDyBZ7GkBqBoJRSGD71QO33iKgfZMXsA+v99RCYmRl4mxqq SC2phDaRJLH/F2djO3Hgzu3pYDvsceAkqJ2RkQjlgmSl/cyUB+jMHea2Xhvp/g3AwNRR zoa/YaTFg/u9uK+nuNh0UpSA1zqHPduAfc219HPUBUSQuTytoWEYtVc9s132kILu0vOW 73TzajgoGmhWViYF49CiSDgw4k7Y81IKcGgOIYHpENmQ4xAguvENsYcci4FU5V9EWQYV IIg0zenB6eckJS2d2ZiuIPohA4dBVEH2vHGExlkxDgeFKJ+XWxFXKJ/bS1eEzeEqRwMj sgFQ== X-Gm-Message-State: AOAM530BdxpXzBnfTYr2P3HiUbpn7IVylzzg086r70/V+FxgD9S+UyFY TKZ411GeTe9/nH9/aoubKVXqkPKJJxBBNA== X-Google-Smtp-Source: ABdhPJymSibs8BoTpT/5Zf62Fw0bwd0Ue6A0t15Cd1lrZV5LaeP23a+vi0uOB1dVP05R3nGxGEzNgw== X-Received: by 2002:a05:6808:2d2:: with SMTP id a18mr12028099oid.82.1621887586407; Mon, 24 May 2021 13:19:46 -0700 (PDT) Received: from nuclearis3.lan (c-98-195-139-126.hsd1.tx.comcast.net. [98.195.139.126]) by smtp.gmail.com with ESMTPSA id w13sm2816338otp.10.2021.05.24.13.19.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 13:19:46 -0700 (PDT) From: Alexandru Gagniuc To: u-boot@lists.denx.de, sjg@chromium.org Cc: trini@konsulko.com, michal.simek@xilinx.com, rasmus.villemoes@prevas.dk, Alexandru Gagniuc Subject: [PATCH v2 06/18] image: Drop IMAGE_ENABLE_SHA1 Date: Mon, 24 May 2021 15:19:27 -0500 Message-Id: <20210524201939.1491676-7-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524201939.1491676-1-mr.nuke.me@gmail.com> References: <20210524201939.1491676-1-mr.nuke.me@gmail.com> 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.102.4 at phobos.denx.de X-Virus-Status: Clean From: Simon Glass We already have a host Kconfig for SHA1. Use CONFIG_IS_ENABLED(SHA1) directly in the code shared with the host build, so we can drop the unnecessary indirection. Signed-off-by: Simon Glass Reviewed-by: Alexandru Gagniuc Signed-off-by: Alexandru Gagniuc --- common/image-fit.c | 2 +- include/image.h | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/common/image-fit.c b/common/image-fit.c index e614643fe3..24e92a8e92 100644 --- a/common/image-fit.c +++ b/common/image-fit.c @@ -1218,7 +1218,7 @@ int calculate_hash(const void *data, int data_len, const char *algo, CHUNKSZ_CRC32); *((uint32_t *)value) = cpu_to_uimage(*((uint32_t *)value)); *value_len = 4; - } else if (IMAGE_ENABLE_SHA1 && strcmp(algo, "sha1") == 0) { + } else if (CONFIG_IS_ENABLED(SHA1) && strcmp(algo, "sha1") == 0) { sha1_csum_wd((unsigned char *)data, data_len, (unsigned char *)value, CHUNKSZ_SHA1); *value_len = 20; diff --git a/include/image.h b/include/image.h index 887a3270bd..8c718adba0 100644 --- a/include/image.h +++ b/include/image.h @@ -68,13 +68,9 @@ struct fdt_region; # ifdef CONFIG_SPL_MD5 # define IMAGE_ENABLE_MD5 1 # endif -# ifdef CONFIG_SPL_FIT_SHA1 -# define IMAGE_ENABLE_SHA1 1 -# endif # else # define IMAGE_ENABLE_CRC32 1 # define IMAGE_ENABLE_MD5 1 -# define IMAGE_ENABLE_SHA1 1 # endif #ifndef IMAGE_ENABLE_CRC32 @@ -85,10 +81,6 @@ struct fdt_region; #define IMAGE_ENABLE_MD5 0 #endif -#ifndef IMAGE_ENABLE_SHA1 -#define IMAGE_ENABLE_SHA1 0 -#endif - #if defined(CONFIG_FIT_SHA256) || \ defined(CONFIG_SPL_FIT_SHA256) #define IMAGE_ENABLE_SHA256 1 -- 2.31.1