Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6754086c authored by Joerg Roedel's avatar Joerg Roedel Committed by Ingo Molnar
Browse files

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: default avatarJoerg Roedel <joerg.roedel@amd.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent c97ac535
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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;
}

/*