diff options
author | Markus Elfring <Markus.Elfring@web.de> | 2023-04-16 08:45:31 +0200 |
---|---|---|
committer | Karol Herbst <kherbst@redhat.com> | 2023-04-17 19:08:04 +0200 |
commit | 8a89e1323d7dc90fa551cf2167ab838013641788 (patch) | |
tree | 75c9fff002afe1351bf1819c7ca116329b6570e6 /drivers/gpu | |
parent | 488c1ce6a8f3d46e20440b2e240e096a20259fcc (diff) | |
download | lwn-8a89e1323d7dc90fa551cf2167ab838013641788.tar.gz lwn-8a89e1323d7dc90fa551cf2167ab838013641788.zip |
drm/nouveau/pci: Move an expression into a function call parameter in nvkm_pcie_set_link()
The variable “pbus” was read only once in the implementation of
the function “nvkm_pcie_set_link”.
Thus move the usage of an expression into a parameter for a function call.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/04e2c1f5-26c7-9a23-5861-3d8757556cdd@web.de
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/pci/pcie.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/pcie.c b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/pcie.c index b295f100e1c1..dd18d9d0bade 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/pcie.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/pcie.c @@ -116,12 +116,10 @@ nvkm_pcie_set_link(struct nvkm_pci *pci, enum nvkm_pcie_speed speed, u8 width) { struct nvkm_subdev *subdev; enum nvkm_pcie_speed cur_speed, max_speed; - struct pci_bus *pbus; int ret; if (!pci || !pci_is_pcie(pci->pdev)) return 0; - pbus = pci->pdev->bus; if (!pci->func->pcie.set_link) return -ENOSYS; @@ -135,7 +133,7 @@ nvkm_pcie_set_link(struct nvkm_pci *pci, enum nvkm_pcie_speed speed, u8 width) } cur_speed = pci->func->pcie.cur_speed(pci); - max_speed = min(nvkm_pcie_speed(pbus->max_bus_speed), + max_speed = min(nvkm_pcie_speed(pci->pdev->bus->max_bus_speed), pci->func->pcie.max_speed(pci)); nvkm_trace(subdev, "current speed: %s\n", nvkm_pcie_speeds[cur_speed]); |