diff options
author | Jiang Liu <jiang.liu@linux.intel.com> | 2014-01-06 14:18:18 +0800 |
---|---|---|
committer | Joerg Roedel <joro@8bytes.org> | 2014-01-09 12:43:37 +0100 |
commit | 7c9197791a0cbbbb0f74aade3339f8e5890fbd15 (patch) | |
tree | 7de99c18c2b40d43decb634b22b03686b6e703db /drivers/iommu/dmar.c | |
parent | 2fe2c6025d6a4939ae2fc97d1d761fc4a8d1abd9 (diff) | |
download | linux-7c9197791a0cbbbb0f74aade3339f8e5890fbd15.tar.gz linux-7c9197791a0cbbbb0f74aade3339f8e5890fbd15.tar.bz2 linux-7c9197791a0cbbbb0f74aade3339f8e5890fbd15.zip |
iommu/vt-d, trivial: simplify code with existing macros
Simplify vt-d related code with existing macros and introduce a new
macro for_each_active_drhd_unit() to enumerate all active DRHD unit.
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Signed-off-by: Joerg Roedel <joro@8bytes.org>
Diffstat (limited to 'drivers/iommu/dmar.c')
-rw-r--r-- | drivers/iommu/dmar.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c index e3c03bb7c374..ee4cb1906e45 100644 --- a/drivers/iommu/dmar.c +++ b/drivers/iommu/dmar.c @@ -1305,15 +1305,14 @@ int dmar_set_interrupt(struct intel_iommu *iommu) int __init enable_drhd_fault_handling(void) { struct dmar_drhd_unit *drhd; + struct intel_iommu *iommu; /* * Enable fault control interrupt. */ - for_each_drhd_unit(drhd) { - int ret; - struct intel_iommu *iommu = drhd->iommu; + for_each_iommu(iommu, drhd) { u32 fault_status; - ret = dmar_set_interrupt(iommu); + int ret = dmar_set_interrupt(iommu); if (ret) { pr_err("DRHD %Lx: failed to enable fault, interrupt, ret %d\n", |