diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2012-07-06 07:28:37 -0400 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2012-07-17 06:14:55 -0400 |
commit | 98f1ad258254d89ffb550a36d59caf9127a9d53f (patch) | |
tree | 4d4bd90b5e052e9f444ce84ec3648397fcb56ec7 /drivers/iommu | |
parent | 84a1caf1453c3d44050bd22db958af4a7f99315c (diff) |
iommu/amd: Fix sparse warnings
A few sparse warnings fire in drivers/iommu/amd_iommu_init.c.
Fix most of them with this patch. Also fix the sparse
warnings in drivers/iommu/irq_remapping.c while at it.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/amd_iommu.c | 2 | ||||
-rw-r--r-- | drivers/iommu/amd_iommu_init.c | 16 | ||||
-rw-r--r-- | drivers/iommu/amd_iommu_types.h | 8 | ||||
-rw-r--r-- | drivers/iommu/amd_iommu_v2.c | 2 | ||||
-rw-r--r-- | drivers/iommu/irq_remapping.c | 5 |
5 files changed, 19 insertions, 14 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 625626391f2d..7f8e7a8bf504 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c | |||
@@ -2073,7 +2073,7 @@ out_err: | |||
2073 | /* FIXME: Move this to PCI code */ | 2073 | /* FIXME: Move this to PCI code */ |
2074 | #define PCI_PRI_TLP_OFF (1 << 15) | 2074 | #define PCI_PRI_TLP_OFF (1 << 15) |
2075 | 2075 | ||
2076 | bool pci_pri_tlp_required(struct pci_dev *pdev) | 2076 | static bool pci_pri_tlp_required(struct pci_dev *pdev) |
2077 | { | 2077 | { |
2078 | u16 status; | 2078 | u16 status; |
2079 | int pos; | 2079 | int pos; |
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c index a33612f3206f..55f2033ea69b 100644 --- a/drivers/iommu/amd_iommu_init.c +++ b/drivers/iommu/amd_iommu_init.c | |||
@@ -190,12 +190,6 @@ static u32 dev_table_size; /* size of the device table */ | |||
190 | static u32 alias_table_size; /* size of the alias table */ | 190 | static u32 alias_table_size; /* size of the alias table */ |
191 | static u32 rlookup_table_size; /* size if the rlookup table */ | 191 | static u32 rlookup_table_size; /* size if the rlookup table */ |
192 | 192 | ||
193 | /* | ||
194 | * This function flushes all internal caches of | ||
195 | * the IOMMU used by this driver. | ||
196 | */ | ||
197 | extern void iommu_flush_all_caches(struct amd_iommu *iommu); | ||
198 | |||
199 | static int amd_iommu_enable_interrupts(void); | 193 | static int amd_iommu_enable_interrupts(void); |
200 | 194 | ||
201 | static inline void update_last_devid(u16 devid) | 195 | static inline void update_last_devid(u16 devid) |
@@ -358,7 +352,7 @@ static void iommu_disable(struct amd_iommu *iommu) | |||
358 | * mapping and unmapping functions for the IOMMU MMIO space. Each AMD IOMMU in | 352 | * mapping and unmapping functions for the IOMMU MMIO space. Each AMD IOMMU in |
359 | * the system has one. | 353 | * the system has one. |
360 | */ | 354 | */ |
361 | static u8 * __init iommu_map_mmio_space(u64 address) | 355 | static u8 __iomem * __init iommu_map_mmio_space(u64 address) |
362 | { | 356 | { |
363 | if (!request_mem_region(address, MMIO_REGION_LENGTH, "amd_iommu")) { | 357 | if (!request_mem_region(address, MMIO_REGION_LENGTH, "amd_iommu")) { |
364 | pr_err("AMD-Vi: Can not reserve memory region %llx for mmio\n", | 358 | pr_err("AMD-Vi: Can not reserve memory region %llx for mmio\n", |
@@ -367,7 +361,7 @@ static u8 * __init iommu_map_mmio_space(u64 address) | |||
367 | return NULL; | 361 | return NULL; |
368 | } | 362 | } |
369 | 363 | ||
370 | return ioremap_nocache(address, MMIO_REGION_LENGTH); | 364 | return (u8 __iomem *)ioremap_nocache(address, MMIO_REGION_LENGTH); |
371 | } | 365 | } |
372 | 366 | ||
373 | static void __init iommu_unmap_mmio_space(struct amd_iommu *iommu) | 367 | static void __init iommu_unmap_mmio_space(struct amd_iommu *iommu) |
@@ -1217,7 +1211,7 @@ static int __init init_exclusion_range(struct ivmd_header *m) | |||
1217 | /* called for unity map ACPI definition */ | 1211 | /* called for unity map ACPI definition */ |
1218 | static int __init init_unity_map_range(struct ivmd_header *m) | 1212 | static int __init init_unity_map_range(struct ivmd_header *m) |
1219 | { | 1213 | { |
1220 | struct unity_map_entry *e = 0; | 1214 | struct unity_map_entry *e = NULL; |
1221 | char *s; | 1215 | char *s; |
1222 | 1216 | ||
1223 | e = kzalloc(sizeof(*e), GFP_KERNEL); | 1217 | e = kzalloc(sizeof(*e), GFP_KERNEL); |
@@ -1727,8 +1721,8 @@ __setup("amd_iommu=", parse_amd_iommu_options); | |||
1727 | 1721 | ||
1728 | IOMMU_INIT_FINISH(amd_iommu_detect, | 1722 | IOMMU_INIT_FINISH(amd_iommu_detect, |
1729 | gart_iommu_hole_init, | 1723 | gart_iommu_hole_init, |
1730 | 0, | 1724 | NULL, |
1731 | 0); | 1725 | NULL); |
1732 | 1726 | ||
1733 | bool amd_iommu_v2_supported(void) | 1727 | bool amd_iommu_v2_supported(void) |
1734 | { | 1728 | { |
diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h index c1b1d489817e..848fc8e37948 100644 --- a/drivers/iommu/amd_iommu_types.h +++ b/drivers/iommu/amd_iommu_types.h | |||
@@ -487,7 +487,7 @@ struct amd_iommu { | |||
487 | /* physical address of MMIO space */ | 487 | /* physical address of MMIO space */ |
488 | u64 mmio_phys; | 488 | u64 mmio_phys; |
489 | /* virtual address of MMIO space */ | 489 | /* virtual address of MMIO space */ |
490 | u8 *mmio_base; | 490 | u8 __iomem *mmio_base; |
491 | 491 | ||
492 | /* capabilities of that IOMMU read from ACPI */ | 492 | /* capabilities of that IOMMU read from ACPI */ |
493 | u32 cap; | 493 | u32 cap; |
@@ -664,6 +664,12 @@ extern bool amd_iommu_force_isolation; | |||
664 | /* Max levels of glxval supported */ | 664 | /* Max levels of glxval supported */ |
665 | extern int amd_iommu_max_glx_val; | 665 | extern int amd_iommu_max_glx_val; |
666 | 666 | ||
667 | /* | ||
668 | * This function flushes all internal caches of | ||
669 | * the IOMMU used by this driver. | ||
670 | */ | ||
671 | extern void iommu_flush_all_caches(struct amd_iommu *iommu); | ||
672 | |||
667 | /* takes bus and device/function and returns the device id | 673 | /* takes bus and device/function and returns the device id |
668 | * FIXME: should that be in generic PCI code? */ | 674 | * FIXME: should that be in generic PCI code? */ |
669 | static inline u16 calc_devid(u8 bus, u8 devfn) | 675 | static inline u16 calc_devid(u8 bus, u8 devfn) |
diff --git a/drivers/iommu/amd_iommu_v2.c b/drivers/iommu/amd_iommu_v2.c index 036fe9bf157e..77c28b721741 100644 --- a/drivers/iommu/amd_iommu_v2.c +++ b/drivers/iommu/amd_iommu_v2.c | |||
@@ -81,7 +81,7 @@ struct fault { | |||
81 | u16 flags; | 81 | u16 flags; |
82 | }; | 82 | }; |
83 | 83 | ||
84 | struct device_state **state_table; | 84 | static struct device_state **state_table; |
85 | static spinlock_t state_lock; | 85 | static spinlock_t state_lock; |
86 | 86 | ||
87 | /* List and lock for all pasid_states */ | 87 | /* List and lock for all pasid_states */ |
diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c index 40cda8e98d87..92769963eac9 100644 --- a/drivers/iommu/irq_remapping.c +++ b/drivers/iommu/irq_remapping.c | |||
@@ -1,6 +1,11 @@ | |||
1 | #include <linux/kernel.h> | 1 | #include <linux/kernel.h> |
2 | #include <linux/string.h> | 2 | #include <linux/string.h> |
3 | #include <linux/cpumask.h> | ||
3 | #include <linux/errno.h> | 4 | #include <linux/errno.h> |
5 | #include <linux/msi.h> | ||
6 | |||
7 | #include <asm/hw_irq.h> | ||
8 | #include <asm/irq_remapping.h> | ||
4 | 9 | ||
5 | #include "irq_remapping.h" | 10 | #include "irq_remapping.h" |
6 | 11 | ||