diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2008-09-17 06:17:00 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-09-19 06:59:26 -0400 |
commit | 6754086ce67c0a1f5d7eac612102368781e14588 (patch) | |
tree | 94ae6594ae234a0c05bc0496017c8e9084f46167 | |
parent | c97ac5359e6897abe22770740294dda185bac30d (diff) |
AMD IOMMU: simplify dma_mask_to_pages
The current calculation is very complicated. This patch replaces it with
a much simpler version.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | arch/x86/kernel/amd_iommu.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c index f405a61f61fc..db64482b1796 100644 --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c | |||
@@ -472,8 +472,7 @@ static int init_unity_mappings_for_device(struct dma_ops_domain *dma_dom, | |||
472 | ****************************************************************************/ | 472 | ****************************************************************************/ |
473 | static unsigned long dma_mask_to_pages(unsigned long mask) | 473 | static unsigned long dma_mask_to_pages(unsigned long mask) |
474 | { | 474 | { |
475 | return (mask >> PAGE_SHIFT) + | 475 | return PAGE_ALIGN(mask) >> PAGE_SHIFT; |
476 | (PAGE_ALIGN(mask & ~PAGE_MASK) >> PAGE_SHIFT); | ||
477 | } | 476 | } |
478 | 477 | ||
479 | /* | 478 | /* |