From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 15/15] efi: initrd: make efi_initrd_register initrd pointer param const
Date: Tue, 27 Jan 2026 09:39:25 +0100 [thread overview]
Message-ID: <20260127084546.3751357-16-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20260127084546.3751357-1-a.fatoum@pengutronix.de>
The initrd buffer isn't actually used in a writable manner, so reflect
that in the types used to hold its base address.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
efi/initrd.c | 4 ++--
efi/loader/bootm.c | 2 +-
include/efi/initrd.h | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/efi/initrd.c b/efi/initrd.c
index 642422b38d2a..01361d0a3071 100644
--- a/efi/initrd.c
+++ b/efi/initrd.c
@@ -35,7 +35,7 @@ static const struct {
static struct linux_initrd {
struct efi_load_file_protocol base;
- void *start;
+ const void *start;
size_t size;
efi_handle_t lf2_handle;
} initrd;
@@ -70,7 +70,7 @@ static efi_status_t EFIAPI efi_initrd_load_file2(
return EFI_SUCCESS;
}
-int efi_initrd_register(void *initrd_base, size_t initrd_sz)
+int efi_initrd_register(const void *initrd_base, size_t initrd_sz)
{
struct efi_boot_services *bs;
efi_status_t efiret;
diff --git a/efi/loader/bootm.c b/efi/loader/bootm.c
index fcc17a03905f..8a0519fca3de 100644
--- a/efi/loader/bootm.c
+++ b/efi/loader/bootm.c
@@ -191,7 +191,7 @@ static efi_status_t efi_install_initrd(struct image_data *data,
if (IS_ERR(initrd_res))
return PTR_ERR(initrd_res);
if (initrd_res)
- efi_initrd_register((void *)initrd_res->start,
+ efi_initrd_register((const void *)initrd_res->start,
resource_size(initrd_res));
return EFI_SUCCESS;
diff --git a/include/efi/initrd.h b/include/efi/initrd.h
index 08af2d299ad6..b36875c7fe7c 100644
--- a/include/efi/initrd.h
+++ b/include/efi/initrd.h
@@ -5,7 +5,7 @@
#include <linux/types.h>
-int efi_initrd_register(void *initrd, size_t initrd_size);
+int efi_initrd_register(const void *initrd, size_t initrd_size);
void efi_initrd_unregister(void);
#endif
--
2.47.3
prev parent reply other threads:[~2026-01-27 9:04 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-27 8:39 [PATCH 00/15] bootm: prepare loadable abstraction rework Ahmad Fatoum
2026-01-27 8:39 ` [PATCH 01/15] FIT: implement fit_count_images Ahmad Fatoum
2026-01-27 8:39 ` [PATCH 02/15] FIT: add image index argument to fit_open_image Ahmad Fatoum
2026-01-27 8:39 ` [PATCH 03/15] resource: implement gap-aware lookup_region Ahmad Fatoum
2026-01-27 8:39 ` [PATCH 04/15] bootm: give bootm_load_ functions an end address Ahmad Fatoum
2026-01-27 15:31 ` Ahmad Fatoum
2026-01-30 13:35 ` Sascha Hauer
2026-01-27 8:39 ` [PATCH 05/15] bootm: store separate image_type and kernel_type Ahmad Fatoum
2026-01-27 8:39 ` [PATCH 06/15] bootm: cache os_file for appendroot purposes Ahmad Fatoum
2026-01-27 8:39 ` [PATCH 07/15] bootm: fit: move length calculation into fit_open Ahmad Fatoum
2026-01-27 8:39 ` [PATCH 08/15] libfile: factor out zero-page resistant read_file as __read_full_anywhere Ahmad Fatoum
2026-01-27 8:39 ` [PATCH 09/15] resource: implement resize_region Ahmad Fatoum
2026-01-30 12:38 ` Sascha Hauer
2026-01-27 8:39 ` [PATCH 10/15] bootm: rename image_data::os/initrd with _uimage suffix Ahmad Fatoum
2026-01-27 8:39 ` [PATCH 11/15] uimage: record original file name in uimage_handle Ahmad Fatoum
2026-01-27 8:39 ` [PATCH 12/15] bootm: factor out file detection into helper Ahmad Fatoum
2026-01-27 8:39 ` [PATCH 13/15] efi: payload: bootm: add dry run support Ahmad Fatoum
2026-01-27 8:39 ` [PATCH 14/15] efi: payload: bootm: fix memory corruption on initrd load error Ahmad Fatoum
2026-01-27 8:39 ` Ahmad Fatoum [this message]
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=20260127084546.3751357-16-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