Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760735AbYBWGQp (ORCPT ); Sat, 23 Feb 2008 01:16:45 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753042AbYBWGPw (ORCPT ); Sat, 23 Feb 2008 01:15:52 -0500 Received: from mo11.iij4u.or.jp ([210.138.174.79]:55465 "EHLO mo11.iij4u.or.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751496AbYBWGPt (ORCPT ); Sat, 23 Feb 2008 01:15:49 -0500 From: FUJITA Tomonori To: linux-kernel@vger.kernel.org Cc: tomof@acm.org, FUJITA Tomonori , Richard Henderson , Ivan Kokshaysky , Andrew Morton Subject: [PATCH -mm 1/4] alpha: convert IOMMU to use ALIGN() Date: Sat, 23 Feb 2008 15:13:12 +0900 Message-Id: <1203747195-7952-2-git-send-email-fujita.tomonori@lab.ntt.co.jp> X-Mailer: git-send-email 1.5.3.7 In-Reply-To: <1203747195-7952-1-git-send-email-fujita.tomonori@lab.ntt.co.jp> References: <1203747195-7952-1-git-send-email-fujita.tomonori@lab.ntt.co.jp> X-Dispatcher: imput version 20040704(IM147) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1582 Lines: 41 This patch is preparation for modifications to fix the IOMMU segment boundary problem. Signed-off-by: FUJITA Tomonori Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Andrew Morton --- 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 26d3789..bbf9990 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; } -- 1.5.3.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/