diff options
author | Luke Shumaker | 2017-12-28 19:08:10 +0100 |
---|---|---|
committer | Laurent Vivier | 2018-03-13 15:01:14 +0100 |
commit | 7ad75eea86e5e9a327a1f64a3e8ec6dbb6534d1e (patch) | |
tree | c4171c3b5f4dea6c0e64d33fa9fc4085802a7f41 /include/hw/virtio/virtio-net.h | |
parent | linux-user: init_guest_commpage: Add a comment about size check (diff) | |
download | qemu-7ad75eea86e5e9a327a1f64a3e8ec6dbb6534d1e.tar.gz qemu-7ad75eea86e5e9a327a1f64a3e8ec6dbb6534d1e.tar.xz qemu-7ad75eea86e5e9a327a1f64a3e8ec6dbb6534d1e.zip |
linux-user: init_guest_space: Clean up control flow a bit
Instead of doing
if (check1) {
if (check2) {
success;
}
}
retry;
Do a clearer
if (!check1) {
goto try_again;
}
if (!check2) {
goto try_again;
}
success;
try_again:
retry;
Besides being clearer, this makes it easier to insert more checks that
need to trigger a retry on check failure, or rearrange them, or anything
like that.
Because some indentation is changing, "ignore space change" may be useful
for viewing this patch.
Signed-off-by: Luke Shumaker <lukeshu@parabola.nu>
Message-Id: <20171228180814.9749-8-lukeshu@lukeshu.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
[lv: modified to try again fi valid == 0, not valid == -1 (error case)]
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'include/hw/virtio/virtio-net.h')
0 files changed, 0 insertions, 0 deletions