[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 1/2] memory-device: not necessary to use goto
From: |
Zeng, Star |
Subject: |
Re: [Qemu-devel] [PATCH v2 1/2] memory-device: not necessary to use goto for the last check |
Date: |
Thu, 8 Aug 2019 01:42:14 +0000 |
> -----Original Message-----
> From: Qemu-devel [mailto:qemu-devel-
> bounces+star.zeng=address@hidden] On Behalf Of Wei Yang
> Sent: Tuesday, July 30, 2019 8:38 AM
> To: address@hidden
> Cc: address@hidden; address@hidden; Wei Yang
> <address@hidden>; address@hidden
> Subject: [Qemu-devel] [PATCH v2 1/2] memory-device: not necessary to use
> goto for the last check
>
> We are already at the last condition check.
>
> Signed-off-by: Wei Yang <address@hidden>
> Reviewed-by: Igor Mammedov <address@hidden>
> Reviewed-by: David Hildenbrand <address@hidden>
> ---
> hw/mem/memory-device.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/hw/mem/memory-device.c b/hw/mem/memory-device.c index
> 5f2c408036..df3261b32a 100644
> --- a/hw/mem/memory-device.c
> +++ b/hw/mem/memory-device.c
> @@ -186,7 +186,6 @@ static uint64_t
> memory_device_get_free_addr(MachineState *ms,
> if (!range_contains_range(&as, &new)) {
> error_setg(errp, "could not find position in guest address space for
> "
> "memory device - memory fragmented due to alignments");
> - goto out;
Is it better to return 0 (or set new_addr to 0) for this error path and another
remaining "goto out" path?
Thanks,
Star
> }
> out:
> g_slist_free(list);
> --
> 2.17.1
>
- Re: [Qemu-devel] [PATCH v2 1/2] memory-device: not necessary to use goto for the last check,
Zeng, Star <=
- Re: [Qemu-devel] [PATCH v2 1/2] memory-device: not necessary to use goto for the last check, Wei Yang, 2019/08/07
- Re: [Qemu-devel] [PATCH v2 1/2] memory-device: not necessary to use goto for the last check, Zeng, Star, 2019/08/07
- Re: [Qemu-devel] [PATCH v2 1/2] memory-device: not necessary to use goto for the last check, Wei Yang, 2019/08/07
- Re: [Qemu-devel] [PATCH v2 1/2] memory-device: not necessary to use goto for the last check, David Hildenbrand, 2019/08/08
- Re: [Qemu-devel] [PATCH v2 1/2] memory-device: not necessary to use goto for the last check, Wei Yang, 2019/08/18
- Re: [Qemu-devel] [PATCH v2 1/2] memory-device: not necessary to use goto for the last check, Zeng, Star, 2019/08/19
- Re: [Qemu-devel] [PATCH v2 1/2] memory-device: not necessary to use goto for the last check, Wei Yang, 2019/08/19