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=-15.7 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,URIBL_BLOCKED,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 BF2C5C12002 for ; Wed, 14 Jul 2021 22:08:08 +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 3453A613C2 for ; Wed, 14 Jul 2021 22:08:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3453A613C2 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 5656B82BF1; Thu, 15 Jul 2021 00:07:37 +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="Xyuwvw5Y"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D5BBF82903; Thu, 15 Jul 2021 00:06: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 7E49F8164D for ; Thu, 15 Jul 2021 00:05:58 +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-x236.google.com with SMTP id u15so4064897oiw.3 for ; Wed, 14 Jul 2021 15:05:58 -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=dJGj4BQPrh7+17imL3rUyci7K7DyypBr+xK9hl2sNoA=; b=Xyuwvw5YNyx39YFgOR3k5hozQFy/0IkKZS6dQ/cXY5AvGwFXJfv3yuCXXWF5qISLX0 Om8ecb8VrkZvOpWLWnFEDNfnyjYto5gAn4iI/8Uix7f615jcVfIsVHuqqEIlLJ5dghOr ciO1Y5EExgDW9VK9xg/YzhTaZ07j8B3JNN45722I9Pk6Ccu5WM+D8j1dCSiUxVMC2gNV UfHoyNpTSNB91vpCNKBx4hCbMM76w1Sk3mFeg+mL8RjYt6QLZSlGE5bxgncc8TDwW5KW qDkFwQLV1V7AQu0fkQXZMeVy7R3Y9EHex7lbmGMp2//+7IEz/2sK/Q6IjKGPQnU7BZIO zWfw== 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=dJGj4BQPrh7+17imL3rUyci7K7DyypBr+xK9hl2sNoA=; b=BaFhqKcnIDAm4aKUn+LT70zxtTi61Wg4jevgIPnSDoYbiM3DWhzA6RHDhD4KpXWOD4 QjQH+rjKE8jOPFJa39A1Hk75QSFtzsaH83KqEXSE9Etjhdg6fs8Cxu+IyfsYfOH1Wcj2 e6LvDDgY1NmdS9s0dbcbylmM79XQwSNFDjh3Rmozd6/yrcGxzFzuQ8+3Ad1EfMZGLKV3 gepLKGBqmuN/Th9RZu/J7G6vSXlwWsqkolOWtSj++ojSgQD7IvGuhvxicEJe0ZvkHDmr kp3R6UfXedM/Hdo8PohZbgw1jMuKuxaLFjRfgAL/mXC6l33XTGAKtojtYEoDz257mtB5 gIvA== X-Gm-Message-State: AOAM533jY2SNwYchx5hWTc2P26c7XhmoBgSTvw1XNprPrmdmaH2cjHa2 +/VKdMghDaTPEj/YrlzdaxRjJ/uJqSs= X-Google-Smtp-Source: ABdhPJwUqAw+PXRt2aJKB9/o3drMAf4m7cYsh7dOqsUYuQ9DVfnDJl7AYFE4miJ2qKG/vreVQ+whZQ== X-Received: by 2002:aca:b485:: with SMTP id d127mr193159oif.46.1626300356814; Wed, 14 Jul 2021 15:05:56 -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 w64sm687278otb.45.2021.07.14.15.05.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jul 2021 15:05:56 -0700 (PDT) From: Alexandru Gagniuc To: u-boot@lists.denx.de, trini@konsulko.com Cc: Simon Glass , Alexandru Gagniuc Subject: [PATCH v3 06/19] image: Drop IMAGE_ENABLE_SHA1 Date: Wed, 14 Jul 2021 17:05:34 -0500 Message-Id: <20210714220547.170371-7-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210714211138.GA25256@bill-the-cat> References: <20210714211138.GA25256@bill-the-cat> 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 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 0c5a05948d..085bdf76d2 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 124448f9e4..bca9033e7f 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