From: Peter Maydell <peter.maydell@linaro.org>
To: Jonathan Marler <johnnymarler@gmail.com>
Cc: Peter Crosthwaite <crosthwaite.peter@gmail.com>,
Alexander Graf <agraf@suse.de>,
QEMU Developers <qemu-devel@nongnu.org>,
QEMU Trivial <qemu-trivial@nongnu.org>,
David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] [PATCH] handle all fdt_get_phandle_errors
Date: Mon, 14 May 2018 16:56:54 +0100 [thread overview]
Message-ID: <CAFEAcA-nnU2E6CKPiGqoAq1sSYtvf4Hxp3MtYiCvigr4i8-+Ow@mail.gmail.com> (raw)
In-Reply-To: <CACKT+Ap2MHCrSCT-0_=KG9UrGAtO7F3EGue6-63-XJxry9=C=w@mail.gmail.com>
On 4 May 2018 at 19:37, Jonathan Marler <johnnymarler@gmail.com> wrote:
> Signed-off-by: Jonathan Marler <johnnymarler@gmail.com>
Hi; thanks for this patch.
> ---
> device_tree.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/device_tree.c b/device_tree.c
> index 52c3358..2b75905 100644
> --- a/device_tree.c
> +++ b/device_tree.c
> @@ -379,8 +379,12 @@ uint32_t qemu_fdt_get_phandle(void *fdt, const char
> *path)
>
> r = fdt_get_phandle(fdt, findnode_nofail(fdt, path));
> if (r == 0) {
> - error_report("%s: Couldn't get phandle for %s: %s", __func__,
> - path, fdt_strerror(r));
> + error_report("%s: Node %s does not have a 'phandle'", __func__,
> + path);
> + exit(1);
> + }
> + if (r == -1) {
> + error_report("%s: Couldn't get phandle for %s", __func__, path);
> exit(1);
> }
Could you explain in what situation this is needed? The documentation
for fdt_get_phandle() says
* returns:
* the phandle of the node at nodeoffset, on success (!= 0, != -1)
* 0, if the node has no phandle, or another error occurs
which I interpret to mean that it is not possible for it to return -1.
thanks
-- PMM
next prev parent reply other threads:[~2018-05-14 15:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-04 18:37 [Qemu-devel] [PATCH] handle all fdt_get_phandle_errors Jonathan Marler
2018-05-14 15:56 ` Stefan Hajnoczi
2018-05-14 15:56 ` Peter Maydell [this message]
2018-06-13 10:34 ` David Gibson
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=CAFEAcA-nnU2E6CKPiGqoAq1sSYtvf4Hxp3MtYiCvigr4i8-+Ow@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=agraf@suse.de \
--cc=crosthwaite.peter@gmail.com \
--cc=david@gibson.dropbear.id.au \
--cc=johnnymarler@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.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;
as well as URLs for NNTP newsgroup(s).