* [Qemu-devel] [PATCH] arch_init: Be sure of only one exit entry with DPRINTF() for ram_load()
@ 2014-05-01 13:28 Chen Gang
2014-05-03 8:41 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
0 siblings, 1 reply; 2+ messages in thread
From: Chen Gang @ 2014-05-01 13:28 UTC (permalink / raw)
To: quintela, owasserm, pbonzini, mst, Eric Blake
Cc: QEMU Trivial, QEMU Developers
When DPRINTF() has effect, the original author wants to print all
ram_load() calling results. So need use 'goto' instead of 'return'
within ram_load(), just like other areas have done.
Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
arch_init.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/arch_init.c b/arch_init.c
index 60c975d..333f698 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -998,7 +998,8 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id)
seq_iter++;
if (version_id < 4 || version_id > 4) {
- return -EINVAL;
+ ret = -EINVAL;
+ goto done;
}
do {
@@ -1055,7 +1056,8 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id)
host = host_from_stream_offset(f, addr, flags);
if (!host) {
- return -EINVAL;
+ ret = -EINVAL;
+ goto done;
}
ch = qemu_get_byte(f);
@@ -1065,14 +1067,16 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id)
host = host_from_stream_offset(f, addr, flags);
if (!host) {
- return -EINVAL;
+ ret = -EINVAL;
+ goto done;
}
qemu_get_buffer(f, host, TARGET_PAGE_SIZE);
} else if (flags & RAM_SAVE_FLAG_XBZRLE) {
void *host = host_from_stream_offset(f, addr, flags);
if (!host) {
- return -EINVAL;
+ ret = -EINVAL;
+ goto done;
}
if (load_xbzrle(f, addr, host) < 0) {
--
1.7.11.7
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [Qemu-trivial] [PATCH] arch_init: Be sure of only one exit entry with DPRINTF() for ram_load()
2014-05-01 13:28 [Qemu-devel] [PATCH] arch_init: Be sure of only one exit entry with DPRINTF() for ram_load() Chen Gang
@ 2014-05-03 8:41 ` Michael Tokarev
0 siblings, 0 replies; 2+ messages in thread
From: Michael Tokarev @ 2014-05-03 8:41 UTC (permalink / raw)
To: Chen Gang, quintela, owasserm, pbonzini, mst, Eric Blake
Cc: QEMU Trivial, QEMU Developers
01.05.2014 17:28, Chen Gang wrote:
> When DPRINTF() has effect, the original author wants to print all
> ram_load() calling results. So need use 'goto' instead of 'return'
> within ram_load(), just like other areas have done.
Applied to -trivial, thank you!
/mjjt
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-05-03 8:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-01 13:28 [Qemu-devel] [PATCH] arch_init: Be sure of only one exit entry with DPRINTF() for ram_load() Chen Gang
2014-05-03 8:41 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
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).