Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Ce Sun and committed by
Alex Deucher
732c6cef 39938a8e

+3 -3
+3 -3
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
··· 6794 6794 struct drm_device *dev = pci_get_drvdata(pdev); 6795 6795 struct amdgpu_device *adev = drm_to_adev(dev); 6796 6796 struct amdgpu_reset_context reset_context; 6797 - struct amdgpu_device *tmp_adev = NULL; 6798 - struct amdgpu_hive_info *hive = NULL; 6797 + struct amdgpu_device *tmp_adev; 6798 + struct amdgpu_hive_info *hive; 6799 6799 struct list_head device_list; 6800 6800 int r = 0, i; 6801 6801 u32 memsize; ··· 6856 6856 dev_info(adev->dev, "PCIe error recovery succeeded\n"); 6857 6857 } else { 6858 6858 dev_err(adev->dev, "PCIe error recovery failed, err:%d\n", r); 6859 - if (tmp_adev) { 6859 + if (hive) { 6860 6860 list_for_each_entry(tmp_adev, &device_list, reset_list) 6861 6861 amdgpu_device_unset_mp1_state(tmp_adev); 6862 6862 amdgpu_device_unlock_reset_domain(adev->reset_domain);