vfio/ap: Remove pointless apdev variable
No need to double-cast, call VFIO_AP_DEVICE() on DeviceState. No functional changes. Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Tony Krowiak <akrowiak@linux.ibm.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Cédric Le Goater <clg@redhat.com>
This commit is contained in:
parent
fde4dbb7e6
commit
88ceb67a6f
@ -156,8 +156,7 @@ static void vfio_ap_realize(DeviceState *dev, Error **errp)
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
Error *err = NULL;
|
Error *err = NULL;
|
||||||
APDevice *apdev = AP_DEVICE(dev);
|
VFIOAPDevice *vapdev = VFIO_AP_DEVICE(dev);
|
||||||
VFIOAPDevice *vapdev = VFIO_AP_DEVICE(apdev);
|
|
||||||
VFIODevice *vbasedev = &vapdev->vdev;
|
VFIODevice *vbasedev = &vapdev->vdev;
|
||||||
|
|
||||||
vbasedev->name = g_path_get_basename(vbasedev->sysfsdev);
|
vbasedev->name = g_path_get_basename(vbasedev->sysfsdev);
|
||||||
@ -197,8 +196,7 @@ error:
|
|||||||
|
|
||||||
static void vfio_ap_unrealize(DeviceState *dev)
|
static void vfio_ap_unrealize(DeviceState *dev)
|
||||||
{
|
{
|
||||||
APDevice *apdev = AP_DEVICE(dev);
|
VFIOAPDevice *vapdev = VFIO_AP_DEVICE(dev);
|
||||||
VFIOAPDevice *vapdev = VFIO_AP_DEVICE(apdev);
|
|
||||||
|
|
||||||
vfio_ap_unregister_irq_notifier(vapdev, VFIO_AP_REQ_IRQ_INDEX);
|
vfio_ap_unregister_irq_notifier(vapdev, VFIO_AP_REQ_IRQ_INDEX);
|
||||||
vfio_detach_device(&vapdev->vdev);
|
vfio_detach_device(&vapdev->vdev);
|
||||||
@ -213,8 +211,7 @@ static Property vfio_ap_properties[] = {
|
|||||||
static void vfio_ap_reset(DeviceState *dev)
|
static void vfio_ap_reset(DeviceState *dev)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
APDevice *apdev = AP_DEVICE(dev);
|
VFIOAPDevice *vapdev = VFIO_AP_DEVICE(dev);
|
||||||
VFIOAPDevice *vapdev = VFIO_AP_DEVICE(apdev);
|
|
||||||
|
|
||||||
ret = ioctl(vapdev->vdev.fd, VFIO_DEVICE_RESET);
|
ret = ioctl(vapdev->vdev.fd, VFIO_DEVICE_RESET);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user