[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 07/10] linux-user: init_guest_space: Clean up co
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 07/10] linux-user: init_guest_space: Clean up control flow a bit |
Date: |
Fri, 2 Mar 2018 13:20:19 +0000 |
On 28 December 2017 at 18:08, Luke Shumaker <address@hidden> wrote:
> From: Luke Shumaker <address@hidden>
>
> 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 <address@hidden>
> ---
> linux-user/elfload.c | 34 +++++++++++++++++++---------------
> 1 file changed, 19 insertions(+), 15 deletions(-)
>
Reviewed-by: Peter Maydell <address@hidden>
thanks
-- PMM
- Re: [Qemu-devel] [PATCH 07/10] linux-user: init_guest_space: Clean up control flow a bit,
Peter Maydell <=