Message ID | 20210503171001.30.I5ba26e911d0ffff8af74ec113d11a5421b0c009f@changeid |
---|---|
State | Changes Requested |
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=doKqL4V4; 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 4FYzY31kdjz9sCD for <incoming@patchwork.ozlabs.org>; Tue, 4 May 2021 09:23:03 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7246B82D15; Tue, 4 May 2021 01:22:47 +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="doKqL4V4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DE37D82CA5; Tue, 4 May 2021 01:22:41 +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-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) (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 C31C682D06 for <u-boot@lists.denx.de>; Tue, 4 May 2021 01:12:20 +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-il1-x135.google.com with SMTP id e2so4927987ilr.1 for <u-boot@lists.denx.de>; Mon, 03 May 2021 16:12:20 -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=2d3Ba3p183Y0KchuMpWdjiq83L5kT0/zdrXI9DePkYM=; b=doKqL4V48BvLjT4WpAOIM64XLC8Fh68npVVSFu4oJHfgfe0/a5x7tfAgkGFeYzSvg9 J7oKIHpJ3JrGg+zJdu5+LbWTNg1vGLg1W2m+6rMB0EB3e1Xf3G5rKvvswGbqyE7LdeBZ 6QLFLDNtCDZjQA0kT+JopzqP0+fiaYGTAvmSI= 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=2d3Ba3p183Y0KchuMpWdjiq83L5kT0/zdrXI9DePkYM=; b=djYD/KSZEaIGQ2tIXVomeEwOyeFhAzXdbuoZJtmf/m0Yl3B+sTSpPmg4uaUAp21C+T JZBYQFjOshK2l+se5XIUGIz29LPprvJ2kL6eH6vfgRhYdoEWnebxNJtpKUxnP4+u8EDx T3AUYUOXRtU0g7j+OlKG8854ccnZKA7HSFBMJJMNXAEQuKS/4oIEaZJj+6dR81UffjnG pLjtnZn+cTCorGjsJYpquR2uk+YR+Tmk1INswUTxZEq1pVXtgdIcG3+yFCZdGja4apIK vkTyZOhuj5/3ygWnfClzQ5tloUB9C6zzqd7WFC8Ufmz3a7DvZLkTpSzkvIs15oAaUAGW 9hPA== X-Gm-Message-State: AOAM531pJQLv+JdQgRLYsPTUQUKNaMsfdRBHRl71EHFGEKKxuSH1Zjvs RK+OsK5feYCKSGjcD5xrSjsa5dUgwcFusQ== X-Google-Smtp-Source: ABdhPJyhJOsvArJtJVaw3SZDUhF24uVgcVCbEZppRNhza5HIUBY5m1F6rGX3YI2f7dVsYqTC6EXHUQ== X-Received: by 2002:a92:d242:: with SMTP id v2mr12940957ilg.135.1620083539383; Mon, 03 May 2021 16:12:19 -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 o6sm422727ioa.21.2021.05.03.16.12.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 May 2021 16:12:19 -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>, Bin Meng <bmeng.cn@gmail.com>, Robert Marko <robert.marko@sartura.hr>, Andre Przywara <andre.przywara@arm.com>, Masahiro Yamada <masahiroy@kernel.org>, Simon Glass <sjg@chromium.org>, AKASHI Takahiro <takahiro.akashi@linaro.org>, Alexandru Gagniuc <mr.nuke.me@gmail.com>, Joe Hershberger <joe.hershberger@ni.com>, Joel Stanley <joel@jms.id.au>, Marek Vasut <marex@denx.de>, Michal Simek <michal.simek@xilinx.com>, Naoki Hayama <naoki.hayama@lineo.co.jp>, Reuben Dowle <reubendowle0@gmail.com>, Sebastian Reichel <sebastian.reichel@collabora.com> Subject: [PATCH 30/49] image: Drop IMAGE_ENABLE_SHA1 Date: Mon, 3 May 2021 17:11:17 -0600 Message-Id: <20210503171001.30.I5ba26e911d0ffff8af74ec113d11a5421b0c009f@changeid> X-Mailer: git-send-email 2.31.1.527.g47e6f16901-goog In-Reply-To: <20210503231136.744283-1-sjg@chromium.org> References: <20210503231136.744283-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(-)