From: Jon Mason Date: Mon, 27 Jun 2011 07:42:17 +0000 (+0000) Subject: mlx4: remove unnecessary read of PCI_CAP_ID_EXP X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a875a4c7404c8e259236b650136b8a603923daf9;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git mlx4: remove unnecessary read of PCI_CAP_ID_EXP The PCIE capability offset is saved during PCI bus walking. It will remove an unnecessary search in the PCI configuration space if this value is referenced instead of reacquiring it. Signed-off-by: Jon Mason Signed-off-by: David S. Miller --- diff --git a/drivers/net/mlx4/reset.c b/drivers/net/mlx4/reset.c index e5741dab3825..11e7c1cb99bf 100644 --- a/drivers/net/mlx4/reset.c +++ b/drivers/net/mlx4/reset.c @@ -77,7 +77,7 @@ int mlx4_reset(struct mlx4_dev *dev) goto out; } - pcie_cap = pci_find_capability(dev->pdev, PCI_CAP_ID_EXP); + pcie_cap = pci_pcie_cap(dev->pdev); for (i = 0; i < 64; ++i) { if (i == 22 || i == 23)