Markus Elfring
8a89e1323d
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
2023-04-17 19:08:04 +02:00
Markus Elfring
488c1ce6a8
drm/nouveau/pci: Move a variable assignment behind condition checks in nvkm_pcie_set_link()
...
The address of a data structure member was determined before
a corresponding null pointer check in the implementation of
the function “nvkm_pcie_set_link”.
Thus avoid the risk for undefined behaviour by moving the assignment
for the variable “subdev” behind some condition checks.
This issue was detected by using the Coccinelle software.
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/b31019b1-bb73-ed93-3378-e551e17a4f32@web.de
2023-04-17 19:08:04 +02:00
Karol Herbst
25c80507dd
drm/nouveau/pci: fix check in nvkm_pcie_set_link
...
v2: remove unneeded pci check
Signed-off-by: Karol Herbst <nouveau@karolherbst.de >
Signed-off-by: Dave Airlie <airlied@redhat.com >
2016-01-14 07:56:37 +10:00
Karol Herbst
bcc19d9bf5
drm/nouveau/pci: implement generic code for pcie speed change
...
v2: rename and group functions
v4: change copyright information
move printing of pcie speeds into oneinit,
rename all pcie functions to nvkm_pcie_*
don't try to raise the pcie version when no higher one is supported
v5: revert Copyright changes and rename nvkm_pcie_raise_version to nvkm_pcie_set_version
v6: remove some useless pci_is_pcie checks and rework messages
Signed-off-by: Karol Herbst <nouveau@karolherbst.de >
2016-01-11 11:30:20 +10:00