mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@barebox.org>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@barebox.org>
Subject: [PATCH 10/10] memory: drop now duplicate request_sdram_region error messages
Date: Mon,  5 Jan 2026 09:03:42 +0100	[thread overview]
Message-ID: <20260105080653.3240497-11-a.fatoum@barebox.org> (raw)
In-Reply-To: <20260105080653.3240497-1-a.fatoum@barebox.org>

Now that we have a general printout inside request_sdram_region, let's
drop the now unneeded duplicate prints.

Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
 arch/arm/lib32/bootm.c | 13 ++-----------
 arch/arm/lib32/bootz.c |  4 +---
 common/bootm-fit.c     | 15 +++------------
 common/bootm.c         |  7 +------
 common/uimage.c        | 12 ++----------
 lib/libfile.c          |  5 +----
 6 files changed, 10 insertions(+), 46 deletions(-)

diff --git a/arch/arm/lib32/bootm.c b/arch/arm/lib32/bootm.c
index dca4fec0204c..c641310147ec 100644
--- a/arch/arm/lib32/bootm.c
+++ b/arch/arm/lib32/bootm.c
@@ -162,12 +162,8 @@ static int optee_verify_header_request_region(struct image_data *data, struct op
 
 	data->tee_res = request_sdram_region("TEE", hdr->init_load_addr_lo, hdr->init_size,
 					     MEMTYPE_RESERVED, MEMATTRS_RW_DEVICE);
-	if (!data->tee_res) {
-		pr_err("Cannot request SDRAM region 0x%08x-0x%08x: %pe\n",
-		       hdr->init_load_addr_lo, hdr->init_load_addr_lo + hdr->init_size - 1,
-		       ERR_PTR(-EINVAL));
+	if (!data->tee_res)
 		return -EINVAL;
-	}
 
 	return 0;
 }
@@ -509,8 +505,6 @@ static int do_bootz_linux(struct image_data *data)
 	data->os_res = request_sdram_region("zimage", load_address, image_size,
 					    MEMTYPE_LOADER_CODE, MEMATTRS_RWX);
 	if (!data->os_res) {
-		pr_err("bootm/zImage: failed to request memory at 0x%lx to 0x%lx (%zu).\n",
-		       load_address, load_address + image_size, image_size);
 		ret = -ENOMEM;
 		goto err_out;
 	}
@@ -634,15 +628,12 @@ static int do_bootm_aimage(struct image_data *data)
 	data->os_res = request_sdram_region("akernel", cmp->load_addr, cmp->size,
 					    MEMTYPE_LOADER_CODE, MEMATTRS_RWX);
 	if (!data->os_res) {
-		pr_err("Cannot request region 0x%08x - 0x%08x, using default load address\n",
-				cmp->load_addr, cmp->size);
+		pr_err("using default load address\n");
 
 		data->os_address = mem_start + PAGE_ALIGN(cmp->size * 4);
 		data->os_res = request_sdram_region("akernel", data->os_address, cmp->size,
 						    MEMTYPE_LOADER_CODE, MEMATTRS_RWX);
 		if (!data->os_res) {
-			pr_err("Cannot request region 0x%08x - 0x%08x\n",
-					cmp->load_addr, cmp->size);
 			ret = -ENOMEM;
 			goto err_out;
 		}
diff --git a/arch/arm/lib32/bootz.c b/arch/arm/lib32/bootz.c
index 0ace36271026..5aa762b4912d 100644
--- a/arch/arm/lib32/bootz.c
+++ b/arch/arm/lib32/bootz.c
@@ -90,10 +90,8 @@ static int do_bootz(int argc, char *argv[])
 					bank->res->start + SZ_8M, end,
 					MEMTYPE_LOADER_CODE,
 					MEMATTRS_RWX);
-			if (!res) {
-				printf("can't request region for kernel\n");
+			if (!res)
 				goto err_out1;
-			}
 		}
 
 		memcpy(zimage, header, sizeof(*header));
diff --git a/common/bootm-fit.c b/common/bootm-fit.c
index f9c8bff43912..3b2252ca8810 100644
--- a/common/bootm-fit.c
+++ b/common/bootm-fit.c
@@ -26,13 +26,9 @@ int bootm_load_fit_os(struct image_data *data, unsigned long load_address)
 	data->os_res = request_sdram_region("kernel",
 			load_address, kernel_size,
 			MEMTYPE_LOADER_CODE, MEMATTRS_RWX);
-	if (!data->os_res) {
-		pr_err("unable to request SDRAM region for kernel at"
-				" 0x%08llx-0x%08llx\n",
-			(unsigned long long)load_address,
-			(unsigned long long)load_address + kernel_size - 1);
+	if (!data->os_res)
 		return -ENOMEM;
-	}
+
 	zero_page_memcpy((void *)load_address, kernel, kernel_size);
 	return 0;
 }
@@ -75,13 +71,8 @@ struct resource *bootm_load_fit_initrd(struct image_data *data, unsigned long lo
 	res = request_sdram_region("initrd",
 				   load_address, initrd_size,
 				   MEMTYPE_LOADER_DATA, MEMATTRS_RW);
-	if (!res) {
-		pr_err("unable to request SDRAM region for initrd at"
-				" 0x%08llx-0x%08llx\n",
-			(unsigned long long)load_address,
-			(unsigned long long)load_address + initrd_size - 1);
+	if (!res)
 		return ERR_PTR(-ENOMEM);
-	}
 
 	memcpy((void *)load_address, initrd, initrd_size);
 	return res;
diff --git a/common/bootm.c b/common/bootm.c
index 933e9dfc69fe..3998443e1aff 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -450,13 +450,8 @@ int bootm_load_devicetree(struct image_data *data, void *fdt,
 
 	data->oftree_res = request_sdram_region("oftree", load_address,
 			fdt_size, MEMTYPE_LOADER_DATA, MEMATTRS_RW);
-	if (!data->oftree_res) {
-		pr_err("unable to request SDRAM region for device tree at"
-				" 0x%08llx-0x%08llx\n",
-			(unsigned long long)load_address,
-			(unsigned long long)load_address + fdt_size - 1);
+	if (!data->oftree_res)
 		return -ENOMEM;
-	}
 
 	memcpy((void *)data->oftree_res->start, fdt, fdt_size);
 
diff --git a/common/uimage.c b/common/uimage.c
index 3e456e9c58ab..5f7087475709 100644
--- a/common/uimage.c
+++ b/common/uimage.c
@@ -349,12 +349,8 @@ static long uimage_sdram_flush(void *buf, unsigned long len)
 		uimage_resource = request_sdram_region("uimage",
 				start, size, MEMTYPE_LOADER_CODE,
 				MEMATTRS_RWX);
-		if (!uimage_resource) {
-			resource_size_t prsize = start + size - 1;
-			printf("unable to request SDRAM %pa - %pa\n",
-				&start, &prsize);
+		if (!uimage_resource)
 			return -ENOMEM;
-		}
 	}
 
 	if (zero_page_contains((unsigned long)uimage_buf + uimage_size))
@@ -388,12 +384,8 @@ struct resource *uimage_load_to_sdram(struct uimage_handle *handle,
 	uimage_resource = request_sdram_region("uimage",
 				start, size, MEMTYPE_LOADER_CODE,
 				MEMATTRS_RWX);
-	if (!uimage_resource) {
-		printf("unable to request SDRAM 0x%08llx-0x%08llx\n",
-			(unsigned long long)start,
-			(unsigned long long)start + size - 1);
+	if (!uimage_resource)
 		return NULL;
-	}
 
 	ret = uimage_load(handle, image_no, uimage_sdram_flush);
 	if (ret) {
diff --git a/lib/libfile.c b/lib/libfile.c
index 01189773b7e3..6b4adc90a0b5 100644
--- a/lib/libfile.c
+++ b/lib/libfile.c
@@ -789,11 +789,8 @@ struct resource *file_to_sdram(const char *filename, unsigned long adr,
 
 		res = request_sdram_region("image", adr, size,
 					   memtype, memattrs);
-		if (!res) {
-			printf("unable to request SDRAM 0x%08lx-0x%08lx\n",
-				adr, adr + size - 1);
+		if (!res)
 			goto out;
-		}
 
 		if (zero_page_contains(res->start + ofs)) {
 			void *tmp = malloc(BUFSIZ);
-- 
2.47.3




  parent reply	other threads:[~2026-01-05  8:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-05  8:03 [PATCH 00/10] bootm: refactor to prepare multiple initrd support Ahmad Fatoum
2026-01-05  8:03 ` [PATCH 01/10] bootm: set image_data::initrd_res at a single place Ahmad Fatoum
2026-01-05  8:03 ` [PATCH 02/10] bootm: fit: split support into dedicated file Ahmad Fatoum
2026-01-05  8:03 ` [PATCH 03/10] bootm: uimage: " Ahmad Fatoum
2026-01-05  8:03 ` [PATCH 04/10] filetype: introduce filetype_fit Ahmad Fatoum
2026-01-05  8:03 ` [PATCH 05/10] bootm: refactor for readability and extensibility Ahmad Fatoum
2026-01-05  8:03 ` [PATCH 06/10] memory: move release_sdram_region into header Ahmad Fatoum
2026-01-05  8:03 ` [PATCH 07/10] resource: make NULL in release_[sdram_]region a no-op Ahmad Fatoum
2026-01-05  8:03 ` [PATCH 08/10] common: elf: use release_region unconditionally Ahmad Fatoum
2026-01-05  8:03 ` [PATCH 09/10] memory: always print errors on request_sdram_region failure Ahmad Fatoum
2026-01-05  8:03 ` Ahmad Fatoum [this message]
2026-01-09  8:20 ` [PATCH 00/10] bootm: refactor to prepare multiple initrd support 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=20260105080653.3240497-11-a.fatoum@barebox.org \
    --to=a.fatoum@barebox.org \
    --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