On 13/2/23 17:24, Eric Farman wrote:
On Mon, 2023-02-13 at 17:10 +0100, Philippe Mathieu-Daudé wrote:
On 13/2/23 16:51, Philippe Mathieu-Daudé wrote:
On 13/2/23 16:29, Eric Farman wrote:
On Mon, 2023-02-13 at 08:08 +0100, Philippe Mathieu-Daudé wrote:
Use the VFIO_CCW() QOM type-checking macro to avoid
DO_UPCAST().

Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
---
   hw/vfio/ccw.c | 35 ++++++++++++++++-------------------
   1 file changed, 16 insertions(+), 19 deletions(-)

       CcwDevice *ccw_dev = DO_UPCAST(CcwDevice, parent_obj,
dev);

If I'm not mistaken, I believe that this (and (un)realize below)
could
be changed to:

     CcwDevice *ccw_dev = CCW_DEVICE(dev);

Even ...

          VFIOCCWDevice *vcdev = VFIO_CCW(dev);

Ha, I didn't look to see if we cared about the intermediary ones, but
this is true here. (Realize cares a bit, but that's easy enough.)


But I somehow got scared to of removing too many casts...

Are these paths covered by a "make check-qtest" on a s390x host?

They are covered by the Avocado tests :)

$ avocado --show=app,console run -t arch:s390x tests/avocado


Woo! Then I'm happy with the big squash then.

Reviewed-by: Eric Farman <far...@linux.ibm.com>

Thanks! Posted cleaned v3 here:
https://lore.kernel.org/qemu-devel/20230213170145.45666-1-phi...@linaro.org/

Reply via email to