diff options
-rw-r--r-- | arch/alpha/kernel/pci_iommu.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/alpha/kernel/pci_iommu.c b/arch/alpha/kernel/pci_iommu.c index 26d3789dfdd0..bbf9990cd238 100644 --- a/arch/alpha/kernel/pci_iommu.c +++ b/arch/alpha/kernel/pci_iommu.c | |||
@@ -136,11 +136,11 @@ iommu_arena_find_pages(struct pci_iommu_arena *arena, long n, long mask) | |||
136 | /* Search forward for the first mask-aligned sequence of N free ptes */ | 136 | /* Search forward for the first mask-aligned sequence of N free ptes */ |
137 | ptes = arena->ptes; | 137 | ptes = arena->ptes; |
138 | nent = arena->size >> PAGE_SHIFT; | 138 | nent = arena->size >> PAGE_SHIFT; |
139 | p = (arena->next_entry + mask) & ~mask; | 139 | p = ALIGN(arena->next_entry, mask + 1); |
140 | i = 0; | 140 | i = 0; |
141 | while (i < n && p+i < nent) { | 141 | while (i < n && p+i < nent) { |
142 | if (ptes[p+i]) | 142 | if (ptes[p+i]) |
143 | p = (p + i + 1 + mask) & ~mask, i = 0; | 143 | p = ALIGN(p + i + 1, mask + 1), i = 0; |
144 | else | 144 | else |
145 | i = i + 1; | 145 | i = i + 1; |
146 | } | 146 | } |
@@ -153,7 +153,7 @@ iommu_arena_find_pages(struct pci_iommu_arena *arena, long n, long mask) | |||
153 | p = 0, i = 0; | 153 | p = 0, i = 0; |
154 | while (i < n && p+i < nent) { | 154 | while (i < n && p+i < nent) { |
155 | if (ptes[p+i]) | 155 | if (ptes[p+i]) |
156 | p = (p + i + 1 + mask) & ~mask, i = 0; | 156 | p = ALIGN(p + i + 1, mask + 1), i = 0; |
157 | else | 157 | else |
158 | i = i + 1; | 158 | i = i + 1; |
159 | } | 159 | } |