summary refs log tree commit diff stats
path: root/hw/mips/mips_r4k.c
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@parabola.nu>2017-12-28 13:08:10 -0500
committerLaurent Vivier <laurent@vivier.eu>2018-03-13 15:01:14 +0100
commit7ad75eea86e5e9a327a1f64a3e8ec6dbb6534d1e (patch)
treec4171c3b5f4dea6c0e64d33fa9fc4085802a7f41 /hw/mips/mips_r4k.c
parent955e304f6fc1703edafed69b299a8ca39233f865 (diff)
downloadfocaccia-qemu-7ad75eea86e5e9a327a1f64a3e8ec6dbb6534d1e.tar.gz
focaccia-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 'hw/mips/mips_r4k.c')
0 files changed, 0 insertions, 0 deletions