PCI/P2PDMA: Simplify distance calculation