linux-user: init_guest_space: Clean up control flow a bit
commit7ad75eea86e5e9a327a1f64a3e8ec6dbb6534d1e
authorLuke Shumaker <lukeshu@parabola.nu>
Thu, 28 Dec 2017 18:08:10 +0000 (28 13:08 -0500)
committerLaurent Vivier <laurent@vivier.eu>
Tue, 13 Mar 2018 14:01:14 +0000 (13 15:01 +0100)
treec4171c3b5f4dea6c0e64d33fa9fc4085802a7f41
parent955e304f6fc1703edafed69b299a8ca39233f865
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>
linux-user/elfload.c