dect
/
linux-2.6
Archived
13
0
Fork 0

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>
This commit is contained in:
Joerg Roedel 2008-09-17 12:17:00 +02:00 committed by Ingo Molnar
parent c97ac5359e
commit 6754086ce6
1 changed files with 1 additions and 2 deletions

View File

@ -472,8 +472,7 @@ static int init_unity_mappings_for_device(struct dma_ops_domain *dma_dom,
****************************************************************************/
static unsigned long dma_mask_to_pages(unsigned long mask)
{
return (mask >> PAGE_SHIFT) +
(PAGE_ALIGN(mask & ~PAGE_MASK) >> PAGE_SHIFT);
return PAGE_ALIGN(mask) >> PAGE_SHIFT;
}
/*