PCI/P2PDMA: Simplify distance calculation
authorChristoph Hellwig <hch@lst.de>
Mon, 14 Jun 2021 05:53:10 +0000 (07:53 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 16 Jun 2021 21:09:41 +0000 (16:09 -0500)
commitd1b8dc09dd71248f5098792af98caa497ec66d19
tree415d7377199fb6d6f208e33e513303381905fcb1
parent3ec0c3ec2d92c09465534a1ff9c6f9d9506ffef6
PCI/P2PDMA: Simplify distance calculation

Merge __calc_map_type_and_dist() and calc_map_type_and_dist_warn() into
calc_map_type_and_dist() to simplify the code a bit.  This now means we add
the devfn strings to the acs_buf unconditionally even if the buffer is not
printed, but that is not a lot of overhead and keeps the code much simpler.

Link: https://lore.kernel.org/r/20210614055310.3960791-1-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
drivers/pci/p2pdma.c