summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
diff options
context:
space:
mode:
authorCe Sun <cesun102@amd.com>2025-04-09 14:53:11 +0300
committerAlex Deucher <alexander.deucher@amd.com>2025-04-11 23:55:55 +0300
commit732c6cefc1ecfc8de5d7a2029480798655d979d8 (patch)
treed7e5d879e047a16d12c7d60fe30580658e8b171c /drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
parent39938a8ed979e398faa3791a47e282c82bcc6f04 (diff)
downloadlinux-732c6cefc1ecfc8de5d7a2029480798655d979d8.tar.xz
drm/amdgpu: Replace tmp_adev with hive in amdgpu_pci_slot_reset
Checking hive is more readable. The following smatch warning: drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:6820 amdgpu_pci_slot_reset() warn: iterator used outside loop: 'tmp_adev' Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Ce Sun <cesun102@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_device.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 66ed6a7924ef..8e150e9393c7 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -6794,8 +6794,8 @@ pci_ers_result_t amdgpu_pci_slot_reset(struct pci_dev *pdev)
struct drm_device *dev = pci_get_drvdata(pdev);
struct amdgpu_device *adev = drm_to_adev(dev);
struct amdgpu_reset_context reset_context;
- struct amdgpu_device *tmp_adev = NULL;
- struct amdgpu_hive_info *hive = NULL;
+ struct amdgpu_device *tmp_adev;
+ struct amdgpu_hive_info *hive;
struct list_head device_list;
int r = 0, i;
u32 memsize;
@@ -6856,7 +6856,7 @@ out:
dev_info(adev->dev, "PCIe error recovery succeeded\n");
} else {
dev_err(adev->dev, "PCIe error recovery failed, err:%d\n", r);
- if (tmp_adev) {
+ if (hive) {
list_for_each_entry(tmp_adev, &device_list, reset_list)
amdgpu_device_unset_mp1_state(tmp_adev);
amdgpu_device_unlock_reset_domain(adev->reset_domain);