From: Alexander Graf <agraf@suse.de>
To: qemu-devel Developers <qemu-devel@nongnu.org>
Cc: blauwirbel@gmail.com, Stefan Weil <sw@weilnetz.de>, qemu-ppc@nongnu.org
Subject: [Qemu-devel] [PATCH 7/8] ppce500_spin: Replace assert by hw_error (fixes compiler warning)
Date: Tue, 1 May 2012 21:50:56 +0200 [thread overview]
Message-ID: <1335901857-29799-8-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1335901857-29799-1-git-send-email-agraf@suse.de>
From: Stefan Weil <sw@weilnetz.de>
The default case in function spin_read should never be reached,
therefore the old code used assert(0) to abort QEMU.
This does not work when QEMU is compiled with macro NDEBUG defined.
In this case (and also when the compiler does not know that assert
never returns), there is a compiler warning because of the missing
return value.
Using hw_error allows an improved error message and aborts always.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
[agraf: use __func__]
Signed-off-by: Alexander Graf <agraf@suse.de>
---
hw/ppce500_spin.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/hw/ppce500_spin.c b/hw/ppce500_spin.c
index 95a2825..fddf219 100644
--- a/hw/ppce500_spin.c
+++ b/hw/ppce500_spin.c
@@ -179,7 +179,7 @@ static uint64_t spin_read(void *opaque, target_phys_addr_t addr, unsigned len)
case 4:
return ldl_p(spin_p);
default:
- assert(0);
+ hw_error("ppce500: unexpected %s with len = %u", __func__, len);
}
}
--
1.6.0.2
next prev parent reply other threads:[~2012-05-01 19:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-01 19:50 [Qemu-devel] [PULL 0/8] ppc patch queue 2012-05-01 Alexander Graf
2012-05-01 19:50 ` [Qemu-devel] [PATCH 1/8] booke:Use MMU API for creating initial mapping for secondary cpus Alexander Graf
2012-05-01 19:50 ` [Qemu-devel] [PATCH 2/8] PPC: Fix up e500 cache size setting Alexander Graf
2012-05-01 19:50 ` [Qemu-devel] [PATCH 3/8] linux-user: Fix undefined HOST_LONG_SIZE on PPC hosts Alexander Graf
2012-05-01 20:51 ` Stefan Weil
2012-05-01 21:02 ` Andreas Färber
2012-05-01 19:50 ` [Qemu-devel] [PATCH 4/8] pseries: Implement automatic PAPR VIO address allocation Alexander Graf
2012-05-01 19:50 ` [Qemu-devel] [PATCH 5/8] pseries: Use the same interrupt swizzling for host bridges as p2p bridges Alexander Graf
2012-05-01 19:50 ` [Qemu-devel] [PATCH 6/8] pseries: Fix use of global CPU state Alexander Graf
2012-05-01 19:50 ` Alexander Graf [this message]
2012-05-01 19:50 ` [Qemu-devel] [PATCH 8/8] target-ppc: Some support for dumping TLB_EMB TLBs Alexander Graf
-- strict thread matches above, loose matches on Subject: below --
2012-05-01 8:58 [Qemu-devel] [PULL 0/8] ppc patch queue 2012-05-01 Alexander Graf
2012-05-01 8:58 ` [Qemu-devel] [PATCH 7/8] ppce500_spin: Replace assert by hw_error (fixes compiler warning) Alexander Graf
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=1335901857-29799-8-git-send-email-agraf@suse.de \
--to=agraf@suse.de \
--cc=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=sw@weilnetz.de \
/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).