summaryrefslogtreecommitdiffstats
path: root/drivers/pci/p2pdma.c
diff options
context:
space:
mode:
authorLogan Gunthorpe <logang@deltatee.com>2021-06-10 18:06:06 +0200
committerBjorn Helgaas <bhelgaas@google.com>2021-06-11 01:01:41 +0200
commitf9c125b9eb30650356cf582003365b1ecbd7003b (patch)
tree228cc5cc6829f40736b2033bf3bd01589b58f5ac /drivers/pci/p2pdma.c
parentPCI/P2PDMA: Collect acs list in stack buffer to avoid sleeping (diff)
downloadlinux-f9c125b9eb30650356cf582003365b1ecbd7003b.tar.xz
linux-f9c125b9eb30650356cf582003365b1ecbd7003b.zip
PCI/P2PDMA: Use correct calc_map_type_and_dist() return type
Instead of using an int for the return value of this function, use the correct enum pci_p2pdma_map_type. Link: https://lore.kernel.org/r/20210610160609.28447-4-logang@deltatee.com Signed-off-by: Logan Gunthorpe <logang@deltatee.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/p2pdma.c')
-rw-r--r--drivers/pci/p2pdma.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c
index 109bd7321962..abcdb2a6b1c0 100644
--- a/drivers/pci/p2pdma.c
+++ b/drivers/pci/p2pdma.c
@@ -546,11 +546,11 @@ calc_map_type_and_dist_warn(struct pci_dev *provider, struct pci_dev *client,
int pci_p2pdma_distance_many(struct pci_dev *provider, struct device **clients,
int num_clients, bool verbose)
{
+ enum pci_p2pdma_map_type map;
bool not_supported = false;
struct pci_dev *pci_client;
int total_dist = 0;
- int distance;
- int i, ret;
+ int i, distance;
if (num_clients == 0)
return -1;
@@ -565,15 +565,15 @@ int pci_p2pdma_distance_many(struct pci_dev *provider, struct device **clients,
}
if (verbose)
- ret = calc_map_type_and_dist_warn(provider, pci_client,
+ map = calc_map_type_and_dist_warn(provider, pci_client,
&distance);
else
- ret = calc_map_type_and_dist(provider, pci_client,
+ map = calc_map_type_and_dist(provider, pci_client,
&distance, NULL, NULL);
pci_dev_put(pci_client);
- if (ret == PCI_P2PDMA_MAP_NOT_SUPPORTED)
+ if (map == PCI_P2PDMA_MAP_NOT_SUPPORTED)
not_supported = true;
if (not_supported && !verbose)