All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] qfw: Don't fail if setup data size is 0
@ 2022-05-25 13:38 Pierre-Clément Tosi
  2022-06-07 16:48 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Pierre-Clément Tosi @ 2022-05-25 13:38 UTC (permalink / raw)
  To: u-boot; +Cc: Pierre-Clément Tosi, Bin Meng, Simon Glass, Andrew Walbran

Skip missing setup data (which is valid) rather than failing with an
error.

Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Reported-by: Andrew Walbran <qwandor@google.com>
Signed-off-by: Pierre-Clément Tosi <ptosi@google.com>
---
 cmd/qfw.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/cmd/qfw.c b/cmd/qfw.c
index d58615040c..ccbc967ca9 100644
--- a/cmd/qfw.c
+++ b/cmd/qfw.c
@@ -25,15 +25,17 @@ static int qemu_fwcfg_cmd_setup_kernel(void *load_addr, void *initrd_addr)
 	qfw_read_entry(qfw_dev, FW_CFG_SETUP_SIZE, 4, &setup_size);
 	qfw_read_entry(qfw_dev, FW_CFG_KERNEL_SIZE, 4, &kernel_size);
 
-	if (setup_size == 0 || kernel_size == 0) {
+	if (kernel_size == 0) {
 		printf("warning: no kernel available\n");
 		return -1;
 	}
 
 	data_addr = load_addr;
-	qfw_read_entry(qfw_dev, FW_CFG_SETUP_DATA,
-		       le32_to_cpu(setup_size), data_addr);
-	data_addr += le32_to_cpu(setup_size);
+	if (setup_size != 0) {
+		qfw_read_entry(qfw_dev, FW_CFG_SETUP_DATA,
+			       le32_to_cpu(setup_size), data_addr);
+		data_addr += le32_to_cpu(setup_size);
+	}
 
 	qfw_read_entry(qfw_dev, FW_CFG_KERNEL_DATA,
 		       le32_to_cpu(kernel_size), data_addr);
-- 
2.36.1.124.g0e6072fb45-goog


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

* Re: [PATCH] qfw: Don't fail if setup data size is 0
  2022-05-25 13:38 [PATCH] qfw: Don't fail if setup data size is 0 Pierre-Clément Tosi
@ 2022-06-07 16:48 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2022-06-07 16:48 UTC (permalink / raw)
  To: Pierre-Clément Tosi; +Cc: u-boot, Bin Meng, Simon Glass, Andrew Walbran

[-- Attachment #1: Type: text/plain, Size: 391 bytes --]

On Wed, May 25, 2022 at 02:38:55PM +0100,  Pierre-Clément Tosi  wrote:

> Skip missing setup data (which is valid) rather than failing with an
> error.
> 
> Cc: Bin Meng <bmeng.cn@gmail.com>
> Cc: Simon Glass <sjg@chromium.org>
> Reported-by: Andrew Walbran <qwandor@google.com>
> Signed-off-by: Pierre-Clément Tosi <ptosi@google.com>

Applied to u-boot/next, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

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

end of thread, other threads:[~2022-06-07 16:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-25 13:38 [PATCH] qfw: Don't fail if setup data size is 0 Pierre-Clément Tosi
2022-06-07 16:48 ` Tom Rini

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.