diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2008-03-04 17:28:54 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-03-04 19:35:13 -0500 |
commit | 3c5f1def7dd50b792f56dcf7378c2684c06947f3 (patch) | |
tree | 3ee439638981815898af44504fa3f7c02fb9d116 /arch/alpha | |
parent | 040922c04cf2c8ac70be2e88a8a9614ecdb41d2e (diff) |
alpha: convert IOMMU to use ALIGN()
This patch is preparation for modifications to fix the IOMMU segment boundary
problem.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/alpha')
-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 | } |