ia64/xen-unstable

changeset 18784:36bda0bb805f

vtd cleanup: change some function return types to void

iommu_suspend(), iommu_resume(), iommu_enable() translation don't have
meaningful return values. Changed their function types to void.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Nov 11 11:07:21 2008 +0000 (2008-11-11)
parents 76e90ac5067e
children 92d0e13b0ea3
files xen/drivers/passthrough/vtd/iommu.c xen/include/xen/iommu.h
line diff
     1.1 --- a/xen/drivers/passthrough/vtd/iommu.c	Tue Nov 11 11:06:27 2008 +0000
     1.2 +++ b/xen/drivers/passthrough/vtd/iommu.c	Tue Nov 11 11:07:21 2008 +0000
     1.3 @@ -634,7 +634,7 @@ static int iommu_set_root_entry(struct i
     1.4      return 0;
     1.5  }
     1.6  
     1.7 -static int iommu_enable_translation(struct iommu *iommu)
     1.8 +static void iommu_enable_translation(struct iommu *iommu)
     1.9  {
    1.10      u32 sts;
    1.11      unsigned long flags;
    1.12 @@ -661,7 +661,6 @@ static int iommu_enable_translation(stru
    1.13      /* Disable PMRs when VT-d engine takes effect per spec definition */
    1.14      disable_pmr(iommu);
    1.15      spin_unlock_irqrestore(&iommu->register_lock, flags);
    1.16 -    return 0;
    1.17  }
    1.18  
    1.19  int iommu_disable_translation(struct iommu *iommu)
    1.20 @@ -1046,8 +1045,7 @@ static int intel_iommu_domain_init(struc
    1.21          for_each_drhd_unit ( drhd )
    1.22          {
    1.23              iommu = drhd->iommu;
    1.24 -            if ( iommu_enable_translation(iommu) )
    1.25 -                return -EIO;
    1.26 +            iommu_enable_translation(iommu);
    1.27          }
    1.28      }
    1.29  
    1.30 @@ -1799,14 +1797,14 @@ static int intel_iommu_group_id(u8 bus, 
    1.31  }
    1.32  
    1.33  static u32 iommu_state[MAX_IOMMUS][MAX_IOMMU_REGS];
    1.34 -int iommu_suspend(void)
    1.35 +void iommu_suspend(void)
    1.36  {
    1.37      struct acpi_drhd_unit *drhd;
    1.38      struct iommu *iommu;
    1.39      u32    i;
    1.40  
    1.41      if ( !vtd_enabled )
    1.42 -        return 0;
    1.43 +        return;
    1.44  
    1.45      iommu_flush_all();
    1.46  
    1.47 @@ -1824,18 +1822,16 @@ int iommu_suspend(void)
    1.48          iommu_state[i][DMAR_FEUADDR_REG] =
    1.49              (u32) dmar_readl(iommu->reg, DMAR_FEUADDR_REG);
    1.50      }
    1.51 -
    1.52 -    return 0;
    1.53  }
    1.54  
    1.55 -int iommu_resume(void)
    1.56 +void iommu_resume(void)
    1.57  {
    1.58      struct acpi_drhd_unit *drhd;
    1.59      struct iommu *iommu;
    1.60      u32 i;
    1.61  
    1.62      if ( !vtd_enabled )
    1.63 -        return 0;
    1.64 +        return;
    1.65  
    1.66      iommu_flush_all();
    1.67  
    1.68 @@ -1855,12 +1851,8 @@ int iommu_resume(void)
    1.69                      (u32) iommu_state[i][DMAR_FEADDR_REG]);
    1.70          dmar_writel(iommu->reg, DMAR_FEUADDR_REG,
    1.71                      (u32) iommu_state[i][DMAR_FEUADDR_REG]);
    1.72 -
    1.73 -        if ( iommu_enable_translation(iommu) )
    1.74 -            return -EIO;
    1.75 +        iommu_enable_translation(iommu);
    1.76      }
    1.77 -
    1.78 -    return 0;
    1.79  }
    1.80  
    1.81  struct iommu_ops intel_iommu_ops = {
     2.1 --- a/xen/include/xen/iommu.h	Tue Nov 11 11:06:27 2008 +0000
     2.2 +++ b/xen/include/xen/iommu.h	Tue Nov 11 11:07:21 2008 +0000
     2.3 @@ -110,7 +110,7 @@ struct iommu_ops {
     2.4  void iommu_update_ire_from_apic(unsigned int apic, unsigned int reg, unsigned int value);
     2.5  void iommu_update_ire_from_msi(struct msi_desc *msi_desc, struct msi_msg *msg);
     2.6  
     2.7 -int iommu_suspend(void);
     2.8 -int iommu_resume(void);
     2.9 +void iommu_suspend(void);
    2.10 +void iommu_resume(void);
    2.11  
    2.12  #endif /* _IOMMU_H_ */