Message ID | 20210506082420.v2.31.I5ba26e911d0ffff8af74ec113d11a5421b0c009f@changeid |
---|---|
State | Deferred |
Delegated to: | Tom Rini |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=XUrk0NEm; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Fbbfz0Q79z9sW7 for <incoming@patchwork.ozlabs.org>; Fri, 7 May 2021 00:33:46 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6011682D43; Thu, 6 May 2021 16:32:39 +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="XUrk0NEm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 686CD82E3A; Thu, 6 May 2021 16:32:28 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-oi1-x230.google.com (mail-oi1-x230.google.com [IPv6:2607:f8b0:4864:20::230]) (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 3297782D73 for <u-boot@lists.denx.de>; Thu, 6 May 2021 16:25:34 +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-x230.google.com with SMTP id j75so5624642oih.10 for <u-boot@lists.denx.de>; Thu, 06 May 2021 07:25:34 -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=cfSfzGlNxOzR7T8t+Ro1z0fmXLyKwBcG92gxS4M7tQs=; b=XUrk0NEmO1Bp5UZTONNLmRE+um3PnkUN0a29xteoxXlzdimKxVIFJSh6NAdFq7saTf pBJ0uftPv5/JnUf3byQhBSqnuo1EYCFUaOwERg2Ox1LiCFJUBcmtL933E7AAycL/QzpT 5Duz0JxQ7GoCUL69dWUfbMw6fbtOT8T50+nP0= 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=cfSfzGlNxOzR7T8t+Ro1z0fmXLyKwBcG92gxS4M7tQs=; b=k8TywCnAhv1//tGj7PUV4nTbhjf6QNz3WavovpqgkDjLh84aZn56KX8TXYi+CAG8S7 pT9q0RdkQu5YkvzorEhuPnyDz7ZPv8Kt547oWkv1alThO4+noY+MZYAKFaKKpJ5Qe7Iq +mij4VGacLFljF2uXIGVGag+on12Tk2Uz9bT9dYOMyjej6Efy42HviughjT8bslO2CAV amw9BHuKgHa3+Z8ULdrC84d9Fus+4IRhUoLGw/2DXE9kq3AUL0q2x9YDnUtyC0pUTkXR UsfNfdqXccIyj6jXu9A8uQ/nQ9MVoPUJhDJLWy05loZA4NCqU1f2774z15L7d08S/90n p8ug== X-Gm-Message-State: AOAM530JzVAj0NvsX1cIyimlckR9G7bGoLufxDJXCXvhK15Mff8dDydw 9dRNCKDbzvOeHiuz4YJN0Tx/9HXVrnPgRQsh X-Google-Smtp-Source: ABdhPJxmpuldc5/A052iVuNDXPJYyEA5Wh4HpTPZOUYeUmUhNXBBQjmTy75zgyoNXBzAp3b2tycZ0g== X-Received: by 2002:aca:c109:: with SMTP id r9mr10884858oif.83.1620311132470; Thu, 06 May 2021 07:25:32 -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 z204sm445490oia.2.2021.05.06.07.25.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 May 2021 07:25:32 -0700 (PDT) From: Simon Glass <sjg@chromium.org> To: U-Boot Mailing List <u-boot@lists.denx.de> Cc: Tom Rini <trini@konsulko.com>, Heinrich Schuchardt <xypron.glpk@gmx.de>, Andre Przywara <andre.przywara@arm.com>, Masahiro Yamada <masahiroy@kernel.org>, Rasmus Villemoes <rasmus.villemoes@prevas.dk>, Robert Marko <robert.marko@sartura.hr>, Bin Meng <bmeng.cn@gmail.com>, Simon Glass <sjg@chromium.org>, Joe Hershberger <joe.hershberger@ni.com>, Marek Vasut <marex@denx.de> Subject: [PATCH v2 31/50] image: Drop IMAGE_ENABLE_SHA1 Date: Thu, 6 May 2021 08:24:19 -0600 Message-Id: <20210506082420.v2.31.I5ba26e911d0ffff8af74ec113d11a5421b0c009f@changeid> X-Mailer: git-send-email 2.31.1.607.g51e8a6a459-goog In-Reply-To: <20210506142438.1310977-1-sjg@chromium.org> References: <20210506142438.1310977-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 <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean |
Series |
image: Reduce #ifdefs and ad-hoc defines in image code
|
expand
|
diff --git a/common/image-fit.c b/common/image-fit.c index 19a2d3c91df..96794074b63 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 9f665a597b0..f5ff77bf0ca 100644 --- a/include/image.h +++ b/include/image.h @@ -46,17 +46,6 @@ struct fdt_region; #include <hash.h> #include <linux/libfdt.h> #include <fdt_support.h> -# ifdef CONFIG_SPL_BUILD -# ifdef CONFIG_SPL_FIT_SHA1 -# define IMAGE_ENABLE_SHA1 1 -# endif -# else -# define IMAGE_ENABLE_SHA1 1 -# endif - -#ifndef IMAGE_ENABLE_SHA1 -#define IMAGE_ENABLE_SHA1 0 -#endif #if defined(CONFIG_FIT_SHA256) || \ defined(CONFIG_SPL_FIT_SHA256)
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 <sjg@chromium.org> --- (no changes since v1) common/image-fit.c | 2 +- include/image.h | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-)