]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit4cc0ad3b84d701019defe51a3a6bb64cd9108d1f
treebdbabd91d77edb3d623292ea97b17d88d053816e
parente55a7cbe34722956cf7e924988498ac057403f8b
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