qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Bernhard Beschow <shentey@gmail.com>
Cc: qemu-trivial@nongnu.org,
	Alistair Francis <alistair.francis@wdc.com>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH] softmmu: Provide a clue as to why device tree loading failed
Date: Mon, 17 Jan 2022 12:16:54 +1100	[thread overview]
Message-ID: <YeTDhrIB/g0i41Bq@yekko.fritz.box> (raw)
In-Reply-To: <20220116114649.40859-1-shentey@gmail.com>

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

On Sun, Jan 16, 2022 at 12:46:49PM +0100, Bernhard Beschow wrote:
> fdt_open_into() obligingly returns an error code in case the operation
> failed. So be obliging as well and use it in the error message.
> 
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  softmmu/device_tree.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/softmmu/device_tree.c b/softmmu/device_tree.c
> index 3965c834ca..31d1066940 100644
> --- a/softmmu/device_tree.c
> +++ b/softmmu/device_tree.c
> @@ -60,7 +60,8 @@ void *create_device_tree(int *sizep)
>      }
>      ret = fdt_open_into(fdt, fdt, *sizep);
>      if (ret) {
> -        error_report("Unable to copy device tree in memory");
> +        error_report("%s: Unable to copy device tree into memory: %s",
> +                     __func__, fdt_strerror(ret));
>          exit(1);
>      }
>  
> @@ -104,7 +105,8 @@ void *load_device_tree(const char *filename_path, int *sizep)
>  
>      ret = fdt_open_into(fdt, fdt, dt_size);
>      if (ret) {
> -        error_report("Unable to copy device tree in memory");
> +        error_report("%s: Unable to copy device tree into memory: %s",
> +                     __func__, fdt_strerror(ret));
>          goto fail;
>      }
>  

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

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

  parent reply	other threads:[~2022-01-17  4:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-16 11:46 [PATCH] softmmu: Provide a clue as to why device tree loading failed Bernhard Beschow
2022-01-16 21:07 ` Philippe Mathieu-Daudé via
2022-01-17  1:16 ` David Gibson [this message]
2022-01-17 22:58 ` Alistair Francis
2022-01-18 11:34 ` Laurent Vivier

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=YeTDhrIB/g0i41Bq@yekko.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=alistair.francis@wdc.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=shentey@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).