summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/amd_iommu_init.c
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2009-05-04 15:06:20 +0200
committerJoerg Roedel <joerg.roedel@amd.com>2009-05-28 18:08:50 +0200
commit3bd221724adb9d642270df0e78b0105fb61e4a1c (patch)
treed5c1cf8dc7e42f3da895b61403779f257511d39d /arch/x86/kernel/amd_iommu_init.c
parent41fb454ebe6024f5c1e3b3cbc0abc0da762e7b51 (diff)
amd-iommu: introduce for_each_iommu* macros
This patch introduces the for_each_iommu and for_each_iommu_safe macros to simplify the developers life when having to iterate over all AMD IOMMUs in the system. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'arch/x86/kernel/amd_iommu_init.c')
-rw-r--r--arch/x86/kernel/amd_iommu_init.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c
index 8c0be0902da..675a4b642f7 100644
--- a/arch/x86/kernel/amd_iommu_init.c
+++ b/arch/x86/kernel/amd_iommu_init.c
@@ -679,7 +679,7 @@ static void __init free_iommu_all(void)
{
struct amd_iommu *iommu, *next;
- list_for_each_entry_safe(iommu, next, &amd_iommu_list, list) {
+ for_each_iommu_safe(iommu, next) {
list_del(&iommu->list);
free_iommu_one(iommu);
kfree(iommu);
@@ -779,7 +779,7 @@ static int __init iommu_setup_msix(struct amd_iommu *iommu)
struct msix_entry entries[32]; /* only 32 supported by AMD IOMMU */
int nvec = 0, i;
- list_for_each_entry(curr, &amd_iommu_list, list) {
+ for_each_iommu(curr) {
if (curr->dev == iommu->dev) {
entries[nvec].entry = curr->evt_msi_num;
entries[nvec].vector = 0;
@@ -818,7 +818,7 @@ static int __init iommu_setup_msi(struct amd_iommu *iommu)
int r;
struct amd_iommu *curr;
- list_for_each_entry(curr, &amd_iommu_list, list) {
+ for_each_iommu(curr) {
if (curr->dev == iommu->dev)
curr->int_enabled = true;
}
@@ -971,7 +971,7 @@ static void __init enable_iommus(void)
{
struct amd_iommu *iommu;
- list_for_each_entry(iommu, &amd_iommu_list, list) {
+ for_each_iommu(iommu) {
iommu_set_exclusion_range(iommu);
iommu_init_msi(iommu);
iommu_enable_event_logging(iommu);