All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Tom Rini <trini@konsulko.com>,
	Neil Armstrong <narmstrong@baylibre.com>,
	Simon Glass <sjg@chromium.org>,
	Alexandru Gagniuc <mr.nuke.me@gmail.com>,
	Artem Lapkin <email2tema@gmail.com>,
	Joe Hershberger <joe.hershberger@ni.com>,
	Leo Yu-Chi Liang <ycliang@andestech.com>,
	Marek Vasut <marex@denx.de>, Michal Simek <michal.simek@amd.com>
Subject: [PATCH 4/8] image: Drop one #ifdef for FIT
Date: Sun, 28 Aug 2022 12:32:49 -0600	[thread overview]
Message-ID: <20220828183253.822815-5-sjg@chromium.org> (raw)
In-Reply-To: <20220828183253.822815-1-sjg@chromium.org>

Drop the #ifdef from near the end of select_ramdisk(). Move some variables
to the top of the function to make this work.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 boot/image-board.c | 39 ++++++++++++++++++++-------------------
 1 file changed, 20 insertions(+), 19 deletions(-)

diff --git a/boot/image-board.c b/boot/image-board.c
index a80ad08b15f..07b7e467cc4 100644
--- a/boot/image-board.c
+++ b/boot/image-board.c
@@ -322,14 +322,16 @@ int genimg_has_config(bootm_headers_t *images)
 static int select_ramdisk(bootm_headers_t *images, const char *select, u8 arch,
 			  ulong *rd_datap, ulong *rd_lenp)
 {
+	const char *fit_uname_config;
+	const char *fit_uname_ramdisk;
 	bool done = false;
+	int rd_noffset;
 	ulong rd_addr;
 	char *buf;
 
 #if CONFIG_IS_ENABLED(FIT)
-		const char *fit_uname_config = images->fit_uname_cfg;
-		const char *fit_uname_ramdisk = NULL;
-		int rd_noffset;
+		fit_uname_config = images->fit_uname_cfg;
+		fit_uname_ramdisk = NULL;
 
 		if (select) {
 			ulong default_addr;
@@ -403,24 +405,23 @@ static int select_ramdisk(bootm_headers_t *images, const char *select, u8 arch,
 				done = true;
 			}
 			break;
-#if CONFIG_IS_ENABLED(FIT)
 		case IMAGE_FORMAT_FIT:
-			rd_noffset = fit_image_load(images,
-						    rd_addr, &fit_uname_ramdisk,
-						    &fit_uname_config, arch,
-						    IH_TYPE_RAMDISK,
-						    BOOTSTAGE_ID_FIT_RD_START,
-						    FIT_LOAD_OPTIONAL_NON_ZERO,
-						    rd_datap, rd_lenp);
-			if (rd_noffset < 0)
-				return rd_noffset;
-
-			images->fit_hdr_rd = map_sysmem(rd_addr, 0);
-			images->fit_uname_rd = fit_uname_ramdisk;
-			images->fit_noffset_rd = rd_noffset;
-			done = true;
+			if (CONFIG_IS_ENABLED(FIT)) {
+				rd_noffset = fit_image_load(images, rd_addr,
+					&fit_uname_ramdisk, &fit_uname_config,
+					arch, IH_TYPE_RAMDISK,
+					BOOTSTAGE_ID_FIT_RD_START,
+					FIT_LOAD_OPTIONAL_NON_ZERO,
+					rd_datap, rd_lenp);
+				if (rd_noffset < 0)
+					return rd_noffset;
+
+				images->fit_hdr_rd = map_sysmem(rd_addr, 0);
+				images->fit_uname_rd = fit_uname_ramdisk;
+				images->fit_noffset_rd = rd_noffset;
+				done = true;
+			}
 			break;
-#endif
 		case IMAGE_FORMAT_ANDROID:
 			if (IS_ENABLED(CONFIG_ANDROID_BOOT_IMAGE)) {
 				void *ptr = map_sysmem(images->os.start, 0);
-- 
2.37.2.672.g94769d06f0-goog


  parent reply	other threads:[~2022-08-28 18:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-28 18:32 [PATCH 0/8] image: Refactor ramdisk code to avoid #ifdef Simon Glass
2022-08-28 18:32 ` [PATCH 1/8] image: Fix up ANDROID_BOOT_IMAGE ramdisk code Simon Glass
2022-08-28 18:32 ` [PATCH 2/8] image: Track when ramdisk processing is completed Simon Glass
2022-08-28 18:32 ` [PATCH 3/8] image: Drop #ifdefs for LEGACY_IMAGE_FORMAT Simon Glass
2022-08-28 18:32 ` Simon Glass [this message]
2022-08-28 18:32 ` [PATCH 5/8] image: Drop another #ifdef for FIT Simon Glass
2022-08-28 18:32 ` [PATCH 6/8] image: Drop remaining FIT #ifdef Simon Glass
2022-08-28 18:32 ` [PATCH 7/8] image: Correct indentation in select_ramdisk() Simon Glass
2022-08-28 18:32 ` [PATCH 8/8] image: Drop some other #ifdefs in image-board.c Simon Glass
2022-09-14 16:22   ` Heinrich Schuchardt
2022-09-14 17:10     ` Simon Glass
2022-09-14 15:53 ` [PATCH 0/8] image: Refactor ramdisk code to avoid #ifdef Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220828183253.822815-5-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=email2tema@gmail.com \
    --cc=joe.hershberger@ni.com \
    --cc=marex@denx.de \
    --cc=michal.simek@amd.com \
    --cc=mr.nuke.me@gmail.com \
    --cc=narmstrong@baylibre.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=ycliang@andestech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.