All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Eric Blake <eblake@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	David Gibson <david@gibson.dropbear.id.au>,
	Alexander Graf <agraf@suse.de>
Cc: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
	"Peter Maydell" <peter.maydell@linaro.org>
Subject: [Qemu-devel] [PATCH v2 2/4] hw/ppc/spapr_drc: Replace error_setg(&error_abort) by abort()
Date: Thu,  7 Jun 2018 11:46:43 -0300	[thread overview]
Message-ID: <20180607144645.10187-3-f4bug@amsat.org> (raw)
In-Reply-To: <20180607144645.10187-1-f4bug@amsat.org>

Use abort() instead of error_setg(&error_abort),
as suggested by the "qapi/error.h" documentation:

    Please don't error_setg(&error_fatal, ...), use error_report() and
    exit(), because that's more obvious.
    Likewise, don't error_setg(&error_abort, ...), use assert().

Use abort() instead of the suggested assert() because the assertion is
already verified by the switch case.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/ppc/spapr_drc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c
index 8a045d6b93..b934b9c9ed 100644
--- a/hw/ppc/spapr_drc.c
+++ b/hw/ppc/spapr_drc.c
@@ -366,7 +366,7 @@ static void prop_get_fdt(Object *obj, Visitor *v, const char *name,
             break;
         }
         default:
-            error_setg(&error_abort, "device FDT in unexpected state: %d", tag);
+            abort(); /* device FDT in unexpected state */
         }
         fdt_offset = fdt_offset_next;
     } while (fdt_depth != 0);
-- 
2.17.1

  parent reply	other threads:[~2018-06-07 14:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-07 14:46 [Qemu-devel] [PATCH v2 0/4] qapi/error: converts error_setg(&error_fatal) to error_report() + exit() Philippe Mathieu-Daudé
2018-06-07 14:46 ` [Qemu-devel] [PATCH v2 1/4] hw/block/fdc: Replace error_setg(&error_abort) by assert() Philippe Mathieu-Daudé
2018-06-07 17:18   ` John Snow
2018-06-08  6:05     ` Markus Armbruster
2018-06-08 15:03       ` John Snow
2018-06-07 14:46 ` Philippe Mathieu-Daudé [this message]
2018-06-08  3:03   ` [Qemu-devel] [PATCH v2 2/4] hw/ppc/spapr_drc: Replace error_setg(&error_abort) by abort() David Gibson
2018-06-08  3:54     ` Philippe Mathieu-Daudé
2018-06-08  4:23       ` David Gibson
2018-06-08  6:22         ` Markus Armbruster
2018-06-07 14:46 ` [Qemu-devel] [PATCH v2 3/4] hw/arm/sysbus-fdt: Replace error_setg(&error_fatal) by error_report() + exit() Philippe Mathieu-Daudé
2018-06-08  6:27   ` Markus Armbruster
2018-06-21 11:14     ` Philippe Mathieu-Daudé
2018-06-07 14:46 ` [Qemu-devel] [PATCH v2 4/4] device_tree: " Philippe Mathieu-Daudé
2018-06-08  3:04   ` 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=20180607144645.10187-3-f4bug@amsat.org \
    --to=f4bug@amsat.org \
    --cc=agraf@suse.de \
    --cc=armbru@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=eblake@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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 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.