[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH-for-5.2 5/5] hw/virtio: Simplify virtio_mem_set_requested
From: |
Markus Armbruster |
Subject: |
Re: [RFC PATCH-for-5.2 5/5] hw/virtio: Simplify virtio_mem_set_requested_size() |
Date: |
Thu, 16 Jul 2020 11:14:20 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
Philippe Mathieu-Daudé <philmd@redhat.com> writes:
> Simplify by directly using visit_type_size() return value.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> hw/virtio/virtio-mem.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c
> index ddf09ed1bf..e407abc2d8 100644
> --- a/hw/virtio/virtio-mem.c
> +++ b/hw/virtio/virtio-mem.c
> @@ -687,12 +687,9 @@ static void virtio_mem_set_requested_size(Object *obj,
> Visitor *v,
> Error **errp)
> {
> VirtIOMEM *vmem = VIRTIO_MEM(obj);
> - Error *err = NULL;
> uint64_t value;
>
> - visit_type_size(v, name, &value, &err);
> - if (err) {
> - error_propagate(errp, err);
> + if (!visit_type_size(v, name, &value, errp)) {
> return;
> }
Crept in after I transformed the pattern in my "Less clumsy error
checking" series. There are a few more instances. I expected that to
happen, and intend to transform stragglers periodically until their
supply dries up.
- [RFC PATCH-for-5.2 0/5] qom: Let ObjectPropertyGet functions return a boolean value, Philippe Mathieu-Daudé, 2020/07/15
- [RFC PATCH-for-5.2 2/5] qom: Split ObjectPropertyAccessor as ObjectProperty[Get/Set], Philippe Mathieu-Daudé, 2020/07/15
- [PATCH-for-5.2 3/5] qom: Use g_autofree in ObjectPropertyGet functions, Philippe Mathieu-Daudé, 2020/07/15
- [RFC PATCH-for-5.2 5/5] hw/virtio: Simplify virtio_mem_set_requested_size(), Philippe Mathieu-Daudé, 2020/07/15
- Re: [RFC PATCH-for-5.2 5/5] hw/virtio: Simplify virtio_mem_set_requested_size(),
Markus Armbruster <=
- [RFC PATCH-for-5.2 4/5] qom: Let ObjectPropertyGet functions return a boolean value, Philippe Mathieu-Daudé, 2020/07/15
- Re: [RFC PATCH-for-5.2 0/5] qom: Let ObjectPropertyGet functions return a boolean value, Markus Armbruster, 2020/07/16