qemu-devel
[Top][All Lists]
Advanced

[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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]