intel-iommu: fix build error with INTR_REMAP=y and DMAR=n
This fix should be safe since iommu->agaw is only used in intel-iommu.c. And this file is only compiled with DMAR=y. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
This commit is contained in:
committed by
David Woodhouse
parent
8e4921515c
commit
43f7392ba9
@@ -491,7 +491,7 @@ int alloc_iommu(struct dmar_drhd_unit *drhd)
|
|||||||
int map_size;
|
int map_size;
|
||||||
u32 ver;
|
u32 ver;
|
||||||
static int iommu_allocated = 0;
|
static int iommu_allocated = 0;
|
||||||
int agaw;
|
int agaw = 0;
|
||||||
|
|
||||||
iommu = kzalloc(sizeof(*iommu), GFP_KERNEL);
|
iommu = kzalloc(sizeof(*iommu), GFP_KERNEL);
|
||||||
if (!iommu)
|
if (!iommu)
|
||||||
@@ -507,6 +507,7 @@ int alloc_iommu(struct dmar_drhd_unit *drhd)
|
|||||||
iommu->cap = dmar_readq(iommu->reg + DMAR_CAP_REG);
|
iommu->cap = dmar_readq(iommu->reg + DMAR_CAP_REG);
|
||||||
iommu->ecap = dmar_readq(iommu->reg + DMAR_ECAP_REG);
|
iommu->ecap = dmar_readq(iommu->reg + DMAR_ECAP_REG);
|
||||||
|
|
||||||
|
#ifdef CONFIG_DMAR
|
||||||
agaw = iommu_calculate_agaw(iommu);
|
agaw = iommu_calculate_agaw(iommu);
|
||||||
if (agaw < 0) {
|
if (agaw < 0) {
|
||||||
printk(KERN_ERR
|
printk(KERN_ERR
|
||||||
@@ -514,6 +515,7 @@ int alloc_iommu(struct dmar_drhd_unit *drhd)
|
|||||||
iommu->seq_id);
|
iommu->seq_id);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
iommu->agaw = agaw;
|
iommu->agaw = agaw;
|
||||||
|
|
||||||
/* the registers might be more than one page */
|
/* the registers might be more than one page */
|
||||||
|
Reference in New Issue
Block a user