diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2007-10-29 00:51:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-29 10:41:32 -0400 |
commit | 4fe05bbcd53160616774b6f5619b8a55bcfa1c57 (patch) | |
tree | f6b03c6b5013ddb3ab13f7521d593d6bed5b1886 | |
parent | b4a08a10b12c145da67cc788849bf7cc6efaa210 (diff) |
intel-iommu fixes
- off by one in dmar_get_fault_reason() (maximal index in array is
ARRAY_SIZE()-1, not ARRAY_SIZE())
- NULL noise removal
- __iomem annotation fix
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/pci/intel-iommu.c | 7 | ||||
-rw-r--r-- | drivers/pci/intel-iommu.h | 2 |
2 files changed, 4 insertions, 5 deletions
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index 0c4ab3b07274..9b35259eecfa 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c | |||
@@ -745,7 +745,7 @@ static char *fault_reason_strings[] = | |||
745 | "non-zero reserved fields in PTE", | 745 | "non-zero reserved fields in PTE", |
746 | "Unknown" | 746 | "Unknown" |
747 | }; | 747 | }; |
748 | #define MAX_FAULT_REASON_IDX ARRAY_SIZE(fault_reason_strings) | 748 | #define MAX_FAULT_REASON_IDX ARRAY_SIZE(fault_reason_strings) - 1 |
749 | 749 | ||
750 | char *dmar_get_fault_reason(u8 fault_reason) | 750 | char *dmar_get_fault_reason(u8 fault_reason) |
751 | { | 751 | { |
@@ -995,7 +995,6 @@ static struct intel_iommu *alloc_iommu(struct dmar_drhd_unit *drhd) | |||
995 | return iommu; | 995 | return iommu; |
996 | error_unmap: | 996 | error_unmap: |
997 | iounmap(iommu->reg); | 997 | iounmap(iommu->reg); |
998 | iommu->reg = 0; | ||
999 | error: | 998 | error: |
1000 | kfree(iommu); | 999 | kfree(iommu); |
1001 | return NULL; | 1000 | return NULL; |
@@ -1808,7 +1807,7 @@ get_valid_domain_for_dev(struct pci_dev *pdev) | |||
1808 | if (!domain) { | 1807 | if (!domain) { |
1809 | printk(KERN_ERR | 1808 | printk(KERN_ERR |
1810 | "Allocating domain for %s failed", pci_name(pdev)); | 1809 | "Allocating domain for %s failed", pci_name(pdev)); |
1811 | return 0; | 1810 | return NULL; |
1812 | } | 1811 | } |
1813 | 1812 | ||
1814 | /* make sure context mapping is ok */ | 1813 | /* make sure context mapping is ok */ |
@@ -1818,7 +1817,7 @@ get_valid_domain_for_dev(struct pci_dev *pdev) | |||
1818 | printk(KERN_ERR | 1817 | printk(KERN_ERR |
1819 | "Domain context map for %s failed", | 1818 | "Domain context map for %s failed", |
1820 | pci_name(pdev)); | 1819 | pci_name(pdev)); |
1821 | return 0; | 1820 | return NULL; |
1822 | } | 1821 | } |
1823 | } | 1822 | } |
1824 | 1823 | ||
diff --git a/drivers/pci/intel-iommu.h b/drivers/pci/intel-iommu.h index ee88dd2400cb..459ad1f9dc54 100644 --- a/drivers/pci/intel-iommu.h +++ b/drivers/pci/intel-iommu.h | |||
@@ -58,7 +58,7 @@ | |||
58 | hi = readl(dmar + reg + 4); \ | 58 | hi = readl(dmar + reg + 4); \ |
59 | (((u64) hi) << 32) + lo; }) | 59 | (((u64) hi) << 32) + lo; }) |
60 | */ | 60 | */ |
61 | static inline u64 dmar_readq(void *addr) | 61 | static inline u64 dmar_readq(void __iomem *addr) |
62 | { | 62 | { |
63 | u32 lo, hi; | 63 | u32 lo, hi; |
64 | lo = readl(addr); | 64 | lo = readl(addr); |