mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] efi: payload: image use new CONFIG_ARM64 symbol
Date: Fri, 20 Sep 2024 11:49:01 +0200	[thread overview]
Message-ID: <20240920094900.1838301-1-a.fatoum@pengutronix.de> (raw)

CONFIG_ARM64 was added as an alternative to CONFIG_CPU_V8 as encountering
the latter in generic code is confusing for users not familiar with ARM.

EFI payload support was one such generic place, so let's replace the
CONFIG_CPU_v8 instance there with the new symbol.

The if clause is moved to keep the order elsewhere in the file, where
x86 checks are done before those for ARM. Both can't be active at the
same time, so no functional change expected.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 efi/payload/image.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/efi/payload/image.c b/efi/payload/image.c
index 6a41338f2a2f..70b57360c99d 100644
--- a/efi/payload/image.c
+++ b/efi/payload/image.c
@@ -163,7 +163,7 @@ static bool is_linux_image(enum filetype filetype, const void *base)
 	    hdr->boot_flag == 0xAA55 && hdr->header == 0x53726448)
 		return true;
 
-	if (IS_ENABLED(CONFIG_CPU_V8) &&
+	if (IS_ENABLED(CONFIG_ARM64) &&
 	    filetype == filetype_arm64_efi_linux_image)
 		return true;
 
@@ -367,12 +367,12 @@ static int efi_register_image_handler(void)
 	register_image_handler(&efi_handle_tr);
 	binfmt_register(&binfmt_efi_hook);
 
-	if (IS_ENABLED(CONFIG_CPU_V8))
-		binfmt_register(&binfmt_arm64_efi_hook);
-
 	if (IS_ENABLED(CONFIG_X86))
 		register_image_handler(&non_efi_handle_linux_x86);
 
+	if (IS_ENABLED(CONFIG_ARM64))
+		binfmt_register(&binfmt_arm64_efi_hook);
+
 	return 0;
 }
 late_efi_initcall(efi_register_image_handler);
-- 
2.39.5




             reply	other threads:[~2024-09-20  9:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-20  9:49 Ahmad Fatoum [this message]
2024-09-27 11:25 ` Sascha Hauer

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=20240920094900.1838301-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox