mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] bootm: add os_type field to struct image_data
@ 2025-12-15  8:52 Ahmad Fatoum
  2025-12-15 11:18 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2025-12-15  8:52 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

We already call file_detect_type() on data->os_header, but do not stash
the result anywhere beyond a local variable in bootm_boot().

Let's save it into struct image_data, so we do not have to repeat the
operation at other places in the upcoming EFI loader patches.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 common/bootm.c  | 2 +-
 include/bootm.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/common/bootm.c b/common/bootm.c
index 22796b3522ac..620eb19ff1d3 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -816,7 +816,7 @@ int bootm_boot(struct bootm_data *bootm_data)
 	if (size < PAGE_SIZE)
 		goto err_out;
 
-	os_type = file_detect_type(data->os_header, PAGE_SIZE);
+	os_type = data->os_type = file_detect_type(data->os_header, PAGE_SIZE);
 
 	if (!data->force && os_type == filetype_unknown) {
 		pr_err("Unknown OS filetype (try -f)\n");
diff --git a/include/bootm.h b/include/bootm.h
index da3e5d7e4b36..b08e20c50da7 100644
--- a/include/bootm.h
+++ b/include/bootm.h
@@ -104,6 +104,7 @@ struct image_data {
 	char *tee_file;
 	struct resource *tee_res;
 
+	enum filetype os_type;
 	enum bootm_verify verify;
 	int verbose;
 	int force;
-- 
2.47.3




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] bootm: add os_type field to struct image_data
  2025-12-15  8:52 [PATCH] bootm: add os_type field to struct image_data Ahmad Fatoum
@ 2025-12-15 11:18 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2025-12-15 11:18 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum


On Mon, 15 Dec 2025 09:52:37 +0100, Ahmad Fatoum wrote:
> We already call file_detect_type() on data->os_header, but do not stash
> the result anywhere beyond a local variable in bootm_boot().
> 
> Let's save it into struct image_data, so we do not have to repeat the
> operation at other places in the upcoming EFI loader patches.
> 
> 
> [...]

Applied, thanks!

[1/1] bootm: add os_type field to struct image_data
      https://git.pengutronix.de/cgit/barebox/commit/?id=ebfb3ee2c8b2 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-12-15 11:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-15  8:52 [PATCH] bootm: add os_type field to struct image_data Ahmad Fatoum
2025-12-15 11:18 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox