[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH qemu v6 10/15] spapr_pci_vfio: Remove unnecessary cast
From: |
Alexey Kardashevskiy |
Subject: |
[Qemu-ppc] [PATCH qemu v6 10/15] spapr_pci_vfio: Remove unnecessary cast to sPAPRPHBVFIOState |
Date: |
Sat, 11 Apr 2015 01:24:39 +1000 |
EEH handlers only need AddressSpace to get to the right VFIO container
to call ioctl() so remove unnecessary cast of sPAPRPHBState to
sPAPRPHBVFIOState.
Signed-off-by: Alexey Kardashevskiy <address@hidden>
---
hw/ppc/spapr_pci_vfio.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/hw/ppc/spapr_pci_vfio.c b/hw/ppc/spapr_pci_vfio.c
index a428166..a5b97d0 100644
--- a/hw/ppc/spapr_pci_vfio.c
+++ b/hw/ppc/spapr_pci_vfio.c
@@ -66,7 +66,6 @@ static void spapr_phb_vfio_reset(DeviceState *qdev)
static int spapr_phb_vfio_eeh_set_option(sPAPRPHBState *sphb,
unsigned int addr, int option)
{
- sPAPRPHBVFIOState *svphb = SPAPR_PCI_VFIO_HOST_BRIDGE(sphb);
struct vfio_eeh_pe_op op = { .argsz = sizeof(op) };
int ret;
@@ -103,7 +102,7 @@ static int spapr_phb_vfio_eeh_set_option(sPAPRPHBState
*sphb,
return RTAS_OUT_PARAM_ERROR;
}
- ret = vfio_container_ioctl(&svphb->phb.iommu_as,
+ ret = vfio_container_ioctl(&sphb->iommu_as,
VFIO_EEH_PE_OP, &op);
if (ret < 0) {
return RTAS_OUT_HW_ERROR;
@@ -114,12 +113,11 @@ static int spapr_phb_vfio_eeh_set_option(sPAPRPHBState
*sphb,
static int spapr_phb_vfio_eeh_get_state(sPAPRPHBState *sphb, int *state)
{
- sPAPRPHBVFIOState *svphb = SPAPR_PCI_VFIO_HOST_BRIDGE(sphb);
struct vfio_eeh_pe_op op = { .argsz = sizeof(op) };
int ret;
op.op = VFIO_EEH_PE_GET_STATE;
- ret = vfio_container_ioctl(&svphb->phb.iommu_as,
+ ret = vfio_container_ioctl(&sphb->iommu_as,
VFIO_EEH_PE_OP, &op);
if (ret < 0) {
return RTAS_OUT_PARAM_ERROR;
@@ -131,7 +129,6 @@ static int spapr_phb_vfio_eeh_get_state(sPAPRPHBState
*sphb, int *state)
static int spapr_phb_vfio_eeh_reset(sPAPRPHBState *sphb, int option)
{
- sPAPRPHBVFIOState *svphb = SPAPR_PCI_VFIO_HOST_BRIDGE(sphb);
struct vfio_eeh_pe_op op = { .argsz = sizeof(op) };
int ret;
@@ -149,7 +146,7 @@ static int spapr_phb_vfio_eeh_reset(sPAPRPHBState *sphb,
int option)
return RTAS_OUT_PARAM_ERROR;
}
- ret = vfio_container_ioctl(&svphb->phb.iommu_as,
+ ret = vfio_container_ioctl(&sphb->iommu_as,
VFIO_EEH_PE_OP, &op);
if (ret < 0) {
return RTAS_OUT_HW_ERROR;
@@ -160,12 +157,11 @@ static int spapr_phb_vfio_eeh_reset(sPAPRPHBState *sphb,
int option)
static int spapr_phb_vfio_eeh_configure(sPAPRPHBState *sphb)
{
- sPAPRPHBVFIOState *svphb = SPAPR_PCI_VFIO_HOST_BRIDGE(sphb);
struct vfio_eeh_pe_op op = { .argsz = sizeof(op) };
int ret;
op.op = VFIO_EEH_PE_CONFIGURE;
- ret = vfio_container_ioctl(&svphb->phb.iommu_as,
+ ret = vfio_container_ioctl(&sphb->iommu_as,
VFIO_EEH_PE_OP, &op);
if (ret < 0) {
return RTAS_OUT_PARAM_ERROR;
--
2.0.0
- Re: [Qemu-ppc] [Qemu-devel] [PATCH qemu v6 04/15] vfio: spapr: Move SPAPR-related code to a separate file, (continued)
- [Qemu-ppc] [PATCH qemu v6 06/15] spapr_pci: Convert finish_realize() to dma_capabilities_update()+dma_init_window(), Alexey Kardashevskiy, 2015/04/10
- [Qemu-ppc] [PATCH qemu v6 11/15] spapr_pci: Do complete reset of DMA config when resetting PHB, Alexey Kardashevskiy, 2015/04/10
- [Qemu-ppc] [PATCH qemu v6 08/15] spapr_iommu: Introduce "enabled" state for TCE table, Alexey Kardashevskiy, 2015/04/10
- [Qemu-ppc] [PATCH qemu v6 10/15] spapr_pci_vfio: Remove unnecessary cast to sPAPRPHBVFIOState,
Alexey Kardashevskiy <=
- [Qemu-ppc] [PATCH qemu v6 13/15] spapr: Add pseries-2.4 machine, Alexey Kardashevskiy, 2015/04/10
- [Qemu-ppc] [PATCH qemu v6 05/15] spapr_pci_vfio: Enable multiple groups per container, Alexey Kardashevskiy, 2015/04/10
- [Qemu-ppc] [PATCH qemu v6 09/15] spapr_iommu: Add root memory region, Alexey Kardashevskiy, 2015/04/10
- [Qemu-ppc] [PATCH qemu v6 07/15] vfio: spapr: Add SPAPR IOMMU v2 support (DMA memory preregistering), Alexey Kardashevskiy, 2015/04/10