qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 1/3] vfio/display: add edid support.


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH v3 1/3] vfio/display: add edid support.
Date: Mon, 11 Mar 2019 07:28:00 +0100
User-agent: NeoMutt/20180716

  Hi,

> Liam and I both found some difficulty with the cleverness of the
> macros, so for the sake of better maintainability, I'd like to propose
> rolling in the following patch, including Liam's trace format fix.  It's
> not as compact as your version, but I think it's equivalent, it's easier
> to follow, and doesn't covertly introduce a non-curly braced block ;)
> If you agree, I'll roll this into your v3. Thanks,

>  #define pwrite_field(_fd, _reg, _ptr, _fld)                             \
> -    if (sizeof(_ptr->_fld) !=                                           \
> -        pwrite(_fd, &(_ptr->_fld), sizeof(_ptr->_fld),                  \
> -               _reg->offset + offsetof(typeof(*_ptr), _fld)))           \
> -        goto err;
> +    (sizeof(_ptr->_fld) !=                                              \
> +     pwrite(_fd, &(_ptr->_fld), sizeof(_ptr->_fld),                     \
> +            _reg->offset + offsetof(typeof(*_ptr), _fld)))

>      dpy->edid_regs->link_state = VFIO_DEVICE_GFX_LINK_STATE_DOWN;
> -    pwrite_field(fd, dpy->edid_info, dpy->edid_regs, link_state);
> +    if (pwrite_field(fd, dpy->edid_info, dpy->edid_regs, link_state)) {
> +        goto err;
> +    }

Fine with me.

thanks,
  Gerd




reply via email to

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