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 74F05C12002 for ; Wed, 14 Jul 2021 22:07:35 +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 C9EAD613A9 for ; Wed, 14 Jul 2021 22:07:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C9EAD613A9 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 E2849829EE; Thu, 15 Jul 2021 00:07:19 +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="SHqjlCBp"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 24999829B9; Thu, 15 Jul 2021 00:06:10 +0200 (CEST) Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [IPv6:2607:f8b0:4864:20::22d]) (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 8708B82916 for ; Thu, 15 Jul 2021 00:05:59 +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-x22d.google.com with SMTP id w188so4022787oif.10 for ; Wed, 14 Jul 2021 15:05:59 -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=bV9UlY4sidFRAjb6iSSSbv+mrburSFUESWRtd2INPuU=; b=SHqjlCBpjtOt5ibYg3SNshK+QFjeOp/up4vw3oXzWQQ4X1Jt4fLU1/9eJT+P3ka5ND FFpWrdHKpUE1GRiqEU3dnFslqePks4Un4wicNf4IpcgphtGzN1nGqbBdAEdv6rdwPZR2 CLkSDQP7ry9Nzc/mLqo2ucFb7RydknexF4AX4+ofC6icbq3o+Wz/lIx6+EAXSMFL70UJ 8XvyznJgF2Z4nbC6aEQvG+hkbOTrvQZIxpzTIopW67ygjseYd2SmVlhOCluMu/8bycvx t71NezE8CT7rdWrqtbr3ke1w5ATZ4i5V1mo8YapmaCCmS+6AnAmCel1fT4LTFySvKTCh nbfA== 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=bV9UlY4sidFRAjb6iSSSbv+mrburSFUESWRtd2INPuU=; b=DqpX8wtSxRShYOdB3FFVbFo/AdypmV3yIAgUU+493CsRX6hRjzDXO7tKMPvdbYnkDv xY4hRd4f55nGtrHfXvY7t4X/sXvhd/gQKDCzH3+Sa3A7xA16mPWj1SzbomoyoayFhYZD 3pL2InaYrf8E0cK9R9QifQSDk5f0XqiCcZYI1ytYADvrl2/QjKQTbA/G82kkwb4MKRRk 7QEp9wMTx4+tdhODP9JYj9pXGCSrdPxtKAXY4cSz2PobLbI0JzIsR0KexgOpuexp+otN d/PUD5rG6xCHedgOb0PYWuf4kEZiHo4EHCyQbEb+w9LTXxSlHGVGKkyakU6t9ks/f7dz XWTw== X-Gm-Message-State: AOAM533dkA4pvjPhw6V2uvYODgiSoi6EcZ5laMW5Wz/XZH9uEb8eAGyg dXh01OnMV5ZiY4hPI3yYmsQg5Br3ieY= X-Google-Smtp-Source: ABdhPJwEHXSxek+Cekb68XLQQm+fXfCoe95fo28kzsSDBYn0XhGigUidHK0his39Ko8VfQYvMzHmAg== X-Received: by 2002:aca:47d6:: with SMTP id u205mr198553oia.44.1626300357842; Wed, 14 Jul 2021 15:05:57 -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.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jul 2021 15:05:57 -0700 (PDT) From: Alexandru Gagniuc To: u-boot@lists.denx.de, trini@konsulko.com Cc: Simon Glass , Alexandru Gagniuc Subject: [PATCH v3 07/19] image: Drop IMAGE_ENABLE_SHAxxx Date: Wed, 14 Jul 2021 17:05:35 -0500 Message-Id: <20210714220547.170371-8-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 these SHA options. Use CONFIG_IS_ENABLED(SHAxxx) directly in the code shared with the host build, so we can drop the unnecessary indirections. Signed-off-by: Simon Glass Reviewed-by: Alexandru Gagniuc Signed-off-by: Alexandru Gagniuc --- common/image-fit.c | 6 +++--- include/image.h | 21 --------------------- 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/common/image-fit.c b/common/image-fit.c index 085bdf76d2..b7e1d33340 100644 --- a/common/image-fit.c +++ b/common/image-fit.c @@ -1222,15 +1222,15 @@ int calculate_hash(const void *data, int data_len, const char *algo, sha1_csum_wd((unsigned char *)data, data_len, (unsigned char *)value, CHUNKSZ_SHA1); *value_len = 20; - } else if (IMAGE_ENABLE_SHA256 && strcmp(algo, "sha256") == 0) { + } else if (CONFIG_IS_ENABLED(SHA256) && strcmp(algo, "sha256") == 0) { sha256_csum_wd((unsigned char *)data, data_len, (unsigned char *)value, CHUNKSZ_SHA256); *value_len = SHA256_SUM_LEN; - } else if (IMAGE_ENABLE_SHA384 && strcmp(algo, "sha384") == 0) { + } else if (CONFIG_IS_ENABLED(SHA384) && strcmp(algo, "sha384") == 0) { sha384_csum_wd((unsigned char *)data, data_len, (unsigned char *)value, CHUNKSZ_SHA384); *value_len = SHA384_SUM_LEN; - } else if (IMAGE_ENABLE_SHA512 && strcmp(algo, "sha512") == 0) { + } else if (CONFIG_IS_ENABLED(SHA512) && strcmp(algo, "sha512") == 0) { sha512_csum_wd((unsigned char *)data, data_len, (unsigned char *)value, CHUNKSZ_SHA512); *value_len = SHA512_SUM_LEN; diff --git a/include/image.h b/include/image.h index bca9033e7f..dbb9bd0174 100644 --- a/include/image.h +++ b/include/image.h @@ -81,27 +81,6 @@ struct fdt_region; #define IMAGE_ENABLE_MD5 0 #endif -#if defined(CONFIG_FIT_SHA256) || \ - defined(CONFIG_SPL_FIT_SHA256) -#define IMAGE_ENABLE_SHA256 1 -#else -#define IMAGE_ENABLE_SHA256 0 -#endif - -#if defined(CONFIG_FIT_SHA384) || \ - defined(CONFIG_SPL_FIT_SHA384) -#define IMAGE_ENABLE_SHA384 1 -#else -#define IMAGE_ENABLE_SHA384 0 -#endif - -#if defined(CONFIG_FIT_SHA512) || \ - defined(CONFIG_SPL_FIT_SHA512) -#define IMAGE_ENABLE_SHA512 1 -#else -#define IMAGE_ENABLE_SHA512 0 -#endif - #endif /* IMAGE_ENABLE_FIT */ #ifdef CONFIG_SYS_BOOT_GET_CMDLINE -- 2.31.1