hw/vfio/ccw: Replace DO_UPCAST(VFIOCCWDevice) by VFIO_CCW()
Use the VFIO_CCW() QOM type-checking macro to avoid DO_UPCAST(). Reviewed-by: Eric Farman <farman@linux.ibm.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230213170145.45666-7-philmd@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
parent
4b447883ed
commit
ecba646895
@ -76,8 +76,7 @@ struct VFIODeviceOps vfio_ccw_ops = {
|
||||
|
||||
static IOInstEnding vfio_ccw_handle_request(SubchDev *sch)
|
||||
{
|
||||
S390CCWDevice *cdev = sch->driver_data;
|
||||
VFIOCCWDevice *vcdev = DO_UPCAST(VFIOCCWDevice, cdev, cdev);
|
||||
VFIOCCWDevice *vcdev = VFIO_CCW(sch->driver_data);
|
||||
struct ccw_io_region *region = vcdev->io_region;
|
||||
int ret;
|
||||
|
||||
@ -125,8 +124,7 @@ again:
|
||||
|
||||
static IOInstEnding vfio_ccw_handle_store(SubchDev *sch)
|
||||
{
|
||||
S390CCWDevice *cdev = sch->driver_data;
|
||||
VFIOCCWDevice *vcdev = DO_UPCAST(VFIOCCWDevice, cdev, cdev);
|
||||
VFIOCCWDevice *vcdev = VFIO_CCW(sch->driver_data);
|
||||
SCHIB *schib = &sch->curr_status;
|
||||
struct ccw_schib_region *region = vcdev->schib_region;
|
||||
SCHIB *s;
|
||||
@ -170,8 +168,7 @@ static IOInstEnding vfio_ccw_handle_store(SubchDev *sch)
|
||||
|
||||
static int vfio_ccw_handle_clear(SubchDev *sch)
|
||||
{
|
||||
S390CCWDevice *cdev = sch->driver_data;
|
||||
VFIOCCWDevice *vcdev = DO_UPCAST(VFIOCCWDevice, cdev, cdev);
|
||||
VFIOCCWDevice *vcdev = VFIO_CCW(sch->driver_data);
|
||||
struct ccw_cmd_region *region = vcdev->async_cmd_region;
|
||||
int ret;
|
||||
|
||||
@ -210,8 +207,7 @@ again:
|
||||
|
||||
static int vfio_ccw_handle_halt(SubchDev *sch)
|
||||
{
|
||||
S390CCWDevice *cdev = sch->driver_data;
|
||||
VFIOCCWDevice *vcdev = DO_UPCAST(VFIOCCWDevice, cdev, cdev);
|
||||
VFIOCCWDevice *vcdev = VFIO_CCW(sch->driver_data);
|
||||
struct ccw_cmd_region *region = vcdev->async_cmd_region;
|
||||
int ret;
|
||||
|
||||
@ -251,8 +247,7 @@ again:
|
||||
|
||||
static void vfio_ccw_reset(DeviceState *dev)
|
||||
{
|
||||
S390CCWDevice *cdev = S390_CCW_DEVICE(dev);
|
||||
VFIOCCWDevice *vcdev = DO_UPCAST(VFIOCCWDevice, cdev, cdev);
|
||||
VFIOCCWDevice *vcdev = VFIO_CCW(dev);
|
||||
|
||||
ioctl(vcdev->vdev.fd, VFIO_DEVICE_RESET);
|
||||
}
|
||||
@ -656,7 +651,7 @@ static void vfio_ccw_realize(DeviceState *dev, Error **errp)
|
||||
{
|
||||
VFIOGroup *group;
|
||||
S390CCWDevice *cdev = S390_CCW_DEVICE(dev);
|
||||
VFIOCCWDevice *vcdev = DO_UPCAST(VFIOCCWDevice, cdev, cdev);
|
||||
VFIOCCWDevice *vcdev = VFIO_CCW(cdev);
|
||||
S390CCWDeviceClass *cdc = S390_CCW_DEVICE_GET_CLASS(cdev);
|
||||
Error *err = NULL;
|
||||
|
||||
@ -727,7 +722,7 @@ out_err_propagate:
|
||||
static void vfio_ccw_unrealize(DeviceState *dev)
|
||||
{
|
||||
S390CCWDevice *cdev = S390_CCW_DEVICE(dev);
|
||||
VFIOCCWDevice *vcdev = DO_UPCAST(VFIOCCWDevice, cdev, cdev);
|
||||
VFIOCCWDevice *vcdev = VFIO_CCW(cdev);
|
||||
S390CCWDeviceClass *cdc = S390_CCW_DEVICE_GET_CLASS(cdev);
|
||||
VFIOGroup *group = vcdev->vdev.group;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user