intel-iommu: Introduce first_pte_in_page() to simplify PTE-setting loops
authorDavid Woodhouse <David.Woodhouse@intel.com>
Thu, 2 Jul 2009 10:21:16 +0000 (11:21 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Thu, 2 Jul 2009 10:27:13 +0000 (11:27 +0100)
commit75e6bf9638992dfc0fec9c3ca10444c8e0d6a638
treebdbabd91d77edb3d623292ea97b17d88d053816e
parent7766a3fb905f0b078b05f5d6a6be8df4c64b9f51
intel-iommu: Introduce first_pte_in_page() to simplify PTE-setting loops

On Wed, 2009-07-01 at 16:59 -0700, Linus Torvalds wrote:
> I also _really_ hate how you do
>
>         (unsigned long)pte >> VTD_PAGE_SHIFT ==
>         (unsigned long)first_pte >> VTD_PAGE_SHIFT

Kill this, in favour of just looking to see if the incremented pte
pointer has 'wrapped' onto the next page. Which means we have to check
it _after_ incrementing it, not before.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/pci/intel-iommu.c