Skip to content

Commit

Permalink
intel-iommu: fix build error with INTR_REMAP=y and DMAR=n
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joerg Roedel authored and David Woodhouse committed Feb 9, 2009
1 parent 8e49215 commit 43f7392
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/pci/dmar.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ int alloc_iommu(struct dmar_drhd_unit *drhd)
int map_size;
u32 ver;
static int iommu_allocated = 0;
int agaw;
int agaw = 0;

iommu = kzalloc(sizeof(*iommu), GFP_KERNEL);
if (!iommu)
Expand All @@ -507,13 +507,15 @@ int alloc_iommu(struct dmar_drhd_unit *drhd)
iommu->cap = dmar_readq(iommu->reg + DMAR_CAP_REG);
iommu->ecap = dmar_readq(iommu->reg + DMAR_ECAP_REG);

#ifdef CONFIG_DMAR
agaw = iommu_calculate_agaw(iommu);
if (agaw < 0) {
printk(KERN_ERR
"Cannot get a valid agaw for iommu (seq_id = %d)\n",
iommu->seq_id);
goto error;
}
#endif
iommu->agaw = agaw;

/* the registers might be more than one page */
Expand Down

0 comments on commit 43f7392

Please sign in to comment.