From: Eric Blake <eblake@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>, armbru@redhat.com
Cc: aik@ozlabs.ru, qemu-ppc@nongnu.org, mdroth@linux.vnet.ibm.com,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 07/10] pseries: Clean up error handling in spapr_rtas_register()
Date: Tue, 19 Jan 2016 15:58:46 -0700 [thread overview]
Message-ID: <569EBFA6.6090709@redhat.com> (raw)
In-Reply-To: <1452859244-9500-8-git-send-email-david@gibson.dropbear.id.au>
[-- Attachment #1: Type: text/plain, Size: 1266 bytes --]
On 01/15/2016 05:00 AM, David Gibson wrote:
> The errors detected in this function necessarily indicate bugs in the rest
> of the qemu code, rather than an external or configuration problem.
>
> So, a simple assert() is more appropriate than any more complex error
> reporting.
>
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> ---
> hw/ppc/spapr_rtas.c | 12 +++---------
> 1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
> index 34b12a3..0be52ae 100644
> --- a/hw/ppc/spapr_rtas.c
> +++ b/hw/ppc/spapr_rtas.c
> @@ -648,17 +648,11 @@ target_ulong spapr_rtas_call(PowerPCCPU *cpu, sPAPRMachineState *spapr,
>
> void spapr_rtas_register(int token, const char *name, spapr_rtas_fn fn)
> {
> - if (!((token >= RTAS_TOKEN_BASE) && (token < RTAS_TOKEN_MAX))) {
> - fprintf(stderr, "RTAS invalid token 0x%x\n", token);
> - exit(1);
> - }
> + assert((token >= RTAS_TOKEN_BASE) && (token < RTAS_TOKEN_MAX));
You could drop the redundant () while touching this, as in:
assert(token >= RTAS_TOKEN_BASE && token < RTAS_TOKEN_MAX);
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2016-01-19 22:58 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-15 12:00 [Qemu-devel] [PATCH 00/10] Cleanups to error reporting on ppc and spapr (v2) David Gibson
2016-01-15 12:00 ` [Qemu-devel] [PATCH 01/10] ppc: Cleanup error handling in ppc_set_compat() David Gibson
2016-01-15 15:19 ` Markus Armbruster
2016-01-17 9:32 ` David Gibson
2016-01-15 12:00 ` [Qemu-devel] [PATCH 02/10] pseries: Cleanup error handling of spapr_cpu_init() David Gibson
2016-01-15 12:00 ` [Qemu-devel] [PATCH 03/10] pseries: Clean up hash page table allocation error handling David Gibson
2016-01-18 2:44 ` Alexey Kardashevskiy
2016-01-18 4:42 ` David Gibson
2016-01-18 5:17 ` Alexey Kardashevskiy
2016-01-18 5:35 ` David Gibson
2016-01-18 6:04 ` Alexey Kardashevskiy
2016-01-18 8:17 ` David Gibson
2016-01-15 12:00 ` [Qemu-devel] [PATCH 04/10] pseries: Clean up error handling in spapr_validate_node_memory() David Gibson
2016-01-15 12:00 ` [Qemu-devel] [PATCH 05/10] pseries: Cleanup error handling in spapr_vga_init() David Gibson
2016-01-15 12:00 ` [Qemu-devel] [PATCH 06/10] pseries: Improve error handling in find_unknown_sysbus_device() David Gibson
2016-01-15 15:40 ` Markus Armbruster
2016-01-18 2:50 ` David Gibson
2016-01-15 12:00 ` [Qemu-devel] [PATCH 07/10] pseries: Clean up error handling in spapr_rtas_register() David Gibson
2016-01-19 22:58 ` Eric Blake [this message]
2016-01-20 0:21 ` Alexey Kardashevskiy
2016-01-20 4:53 ` Eric Blake
2016-01-20 5:53 ` Alexey Kardashevskiy
2016-01-20 10:08 ` Thomas Huth
2016-01-20 7:18 ` Markus Armbruster
2016-01-20 8:15 ` Alexey Kardashevskiy
2016-01-20 9:27 ` Markus Armbruster
2016-01-15 12:00 ` [Qemu-devel] [PATCH 08/10] pseries: Clean up error handling in xics_system_init() David Gibson
2016-01-15 12:00 ` [Qemu-devel] [PATCH 09/10] pseries: Clean up error reporting in ppc_spapr_init() David Gibson
2016-01-15 12:00 ` [Qemu-devel] [PATCH 10/10] pseries: Clean up error reporting in htab migration functions David Gibson
2016-01-15 15:47 ` [Qemu-devel] [PATCH 00/10] Cleanups to error reporting on ppc and spapr (v2) Markus Armbruster
2016-01-16 13:15 ` David Gibson
2016-01-17 23:56 ` Alexey Kardashevskiy
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=569EBFA6.6090709@redhat.com \
--to=eblake@redhat.com \
--cc=aik@ozlabs.ru \
--cc=armbru@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=mdroth@linux.vnet.ibm.com \
--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 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).