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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9836DECAAA2 for ; Sun, 28 Aug 2022 18:35:47 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8B450845BE; Sun, 28 Aug 2022 20:35:45 +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="Qv4DI7cE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CB5578492F; Sun, 28 Aug 2022 20:33:17 +0200 (CEST) Received: from mail-oa1-x2d.google.com (mail-oa1-x2d.google.com [IPv6:2001:4860:4864:20::2d]) (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 476A9847EF for ; Sun, 28 Aug 2022 20:33:13 +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-oa1-x2d.google.com with SMTP id 586e51a60fabf-f2a4c51c45so8132965fac.9 for ; Sun, 28 Aug 2022 11:33:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=PZW0MU6k2m0GpVhTEHAHDYFvfAni55PVD3GcWe1GL0E=; b=Qv4DI7cEyTncnb+hplcywmxC1j8WVCRNGR0iVAAsxiLSa9TPFax6VNLS9Viv2gVc/c Hj0x6wNJpmMNWFQFcumX2oYf0h97A1IxVwQfuXf9PwuZDkslqEND2rBb0MtcKViaV5Ai UtzxHH4owVNI12zyh1H+49OdsCFofgbBCNY84= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=PZW0MU6k2m0GpVhTEHAHDYFvfAni55PVD3GcWe1GL0E=; b=2wrHINPAUl/y+nr74fCwtZOhyZTljoCEs0B6eyZNj2v4FNSI6EdqbTpcK0a//NAwzw /wx/jRRXZ0iX6ggBLbPSEFvgeKdAs8grPCdQpcqRvQbSgYOoxQfFBFTyWBSBFWKEXRMZ R4iptodVIGIcDe08JxNsMazh2DuYCwc/z9y3CHDtCHxTu4ZGwmqn8Mx/rvBdoiTOnKhH 6W7TvxShjmJauHLtQ4C3kBxBhHOP3f6yQRupa7WAvShFDgFGtzA+gLZTothMiWT9gQRC WMmunwmis3KzxF5sfzZxELi69rVFw1YY35wpkq+gaLUJRWreKVZ9TxO48a0HtzVWZ8NY 3iTw== X-Gm-Message-State: ACgBeo11e+phgdQoBlf3OXclbH1CwLuVmwW6NuHBAJol+8kGSHYRx1qU 5ABO9XwcnBQy8Dem/pdXRzIY7Xt8WbwgBQ== X-Google-Smtp-Source: AA6agR5mRJm2pSVcKpl6ojG9I/QO8F3V1M/KaII3xSBpmpzlRuJUYSvguNQlzDcYbJ+67nZn5uAHcA== X-Received: by 2002:a05:6870:231b:b0:116:7e15:1593 with SMTP id w27-20020a056870231b00b001167e151593mr5943437oao.268.1661711591658; Sun, 28 Aug 2022 11:33:11 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-67-190-102-125.hsd1.co.comcast.net. [67.190.102.125]) by smtp.gmail.com with ESMTPSA id 91-20020a9d0de4000000b006339b36127dsm4299771ots.3.2022.08.28.11.33.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Aug 2022 11:33:11 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Neil Armstrong , Simon Glass , Alexandru Gagniuc , Artem Lapkin , Joe Hershberger , Leo Yu-Chi Liang , Marek Vasut , Michal Simek Subject: [PATCH 3/8] image: Drop #ifdefs for LEGACY_IMAGE_FORMAT Date: Sun, 28 Aug 2022 12:32:48 -0600 Message-Id: <20220828183253.822815-4-sjg@chromium.org> X-Mailer: git-send-email 2.37.2.672.g94769d06f0-goog In-Reply-To: <20220828183253.822815-1-sjg@chromium.org> References: <20220828183253.822815-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean Use if() instead of the #ifdef in select_ramdisk(). Signed-off-by: Simon Glass --- boot/image-board.c | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/boot/image-board.c b/boot/image-board.c index 2d5e5b6e6f0..a80ad08b15f 100644 --- a/boot/image-board.c +++ b/boot/image-board.c @@ -24,7 +24,6 @@ DECLARE_GLOBAL_DATA_PTR; -#if CONFIG_IS_ENABLED(LEGACY_IMAGE_FORMAT) /** * image_get_ramdisk - get and verify ramdisk image * @rd_addr: ramdisk image start address @@ -83,7 +82,6 @@ static const image_header_t *image_get_ramdisk(ulong rd_addr, u8 arch, return rd_hdr; } -#endif /*****************************************************************************/ /* Shared dual-format routines */ @@ -386,26 +384,25 @@ static int select_ramdisk(bootm_headers_t *images, const char *select, u8 arch, */ buf = map_sysmem(rd_addr, 0); switch (genimg_get_format(buf)) { -#if CONFIG_IS_ENABLED(LEGACY_IMAGE_FORMAT) - case IMAGE_FORMAT_LEGACY: { - const image_header_t *rd_hdr; + case IMAGE_FORMAT_LEGACY: + if (CONFIG_IS_ENABLED(LEGACY_IMAGE_FORMAT)) { + const image_header_t *rd_hdr; - printf("## Loading init Ramdisk from Legacy Image at %08lx ...\n", - rd_addr); + printf("## Loading init Ramdisk from Legacy Image at %08lx ...\n", + rd_addr); - bootstage_mark(BOOTSTAGE_ID_CHECK_RAMDISK); - rd_hdr = image_get_ramdisk(rd_addr, arch, - images->verify); + bootstage_mark(BOOTSTAGE_ID_CHECK_RAMDISK); + rd_hdr = image_get_ramdisk(rd_addr, arch, + images->verify); - if (!rd_hdr) - return -ENOENT; + if (!rd_hdr) + return -ENOENT; - *rd_datap = image_get_data(rd_hdr); - *rd_lenp = image_get_data_size(rd_hdr); - done = true; + *rd_datap = image_get_data(rd_hdr); + *rd_lenp = image_get_data_size(rd_hdr); + done = true; + } break; - } -#endif #if CONFIG_IS_ENABLED(FIT) case IMAGE_FORMAT_FIT: rd_noffset = fit_image_load(images, -- 2.37.2.672.g94769d06f0-goog