From: FUJITA Tomonori Date: Tue, 4 Mar 2008 22:28:54 +0000 (-0800) Subject: alpha: convert IOMMU to use ALIGN() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3c5f1def7dd50b792f56dcf7378c2684c06947f3;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git alpha: convert IOMMU to use ALIGN() This patch is preparation for modifications to fix the IOMMU segment boundary problem. Signed-off-by: FUJITA Tomonori Cc: Richard Henderson Cc: Ivan Kokshaysky Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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) /* Search forward for the first mask-aligned sequence of N free ptes */ ptes = arena->ptes; nent = arena->size >> PAGE_SHIFT; - p = (arena->next_entry + mask) & ~mask; + p = ALIGN(arena->next_entry, mask + 1); i = 0; while (i < n && p+i < nent) { if (ptes[p+i]) - p = (p + i + 1 + mask) & ~mask, i = 0; + p = ALIGN(p + i + 1, mask + 1), i = 0; else i = i + 1; } @@ -153,7 +153,7 @@ iommu_arena_find_pages(struct pci_iommu_arena *arena, long n, long mask) p = 0, i = 0; while (i < n && p+i < nent) { if (ptes[p+i]) - p = (p + i + 1 + mask) & ~mask, i = 0; + p = ALIGN(p + i + 1, mask + 1), i = 0; else i = i + 1; }