On 28 December 2017 at 18:08, Luke Shumaker <luke...@lukeshu.com> wrote:
> From: Luke Shumaker <luke...@parabola.nu>
>
> 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 <luke...@parabola.nu>
> ---
>  linux-user/elfload.c | 34 +++++++++++++++++++---------------
>  1 file changed, 19 insertions(+), 15 deletions(-)
>

Reviewed-by: Peter Maydell <peter.mayd...@linaro.org>

thanks
-- PMM

Reply via email to