All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: Replace tmp_adev with hive in amdgpu_pci_slot_reset
@ 2025-04-09 13:18 Ce Sun
  2025-04-09 13:32 ` Christian König
  0 siblings, 1 reply; 7+ messages in thread
From: Ce Sun @ 2025-04-09 13:18 UTC (permalink / raw)
  To: amd-gfx; +Cc: dan.carpenter, Ce Sun

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'

Fixes: 8ba904f54148 ("drm/amdgpu: Multi-GPU DPC recovery support")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Ce Sun <cesun102@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 60269fba5745..eb0589a09a27 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -6846,7 +6846,7 @@ pci_ers_result_t amdgpu_pci_slot_reset(struct pci_dev *pdev)
 		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);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [PATCH] drm/amdgpu: Replace tmp_adev with hive in amdgpu_pci_slot_reset
@ 2025-04-09 13:39 Ce Sun
  2025-04-09 13:44 ` Christian König
  2025-04-09 13:49 ` Lazar, Lijo
  0 siblings, 2 replies; 7+ messages in thread
From: Ce Sun @ 2025-04-09 13:39 UTC (permalink / raw)
  To: amd-gfx; +Cc: dan.carpenter, Ce Sun

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'

Fixes: 8ba904f54148 ("drm/amdgpu: Multi-GPU DPC recovery support")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Ce Sun <cesun102@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 +++---
 1 file 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 60269fba5745..6fb234832ff3 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -6784,8 +6784,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;
@@ -6846,7 +6846,7 @@ pci_ers_result_t amdgpu_pci_slot_reset(struct pci_dev *pdev)
 		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);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-04-10 13:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-09 13:18 [PATCH] drm/amdgpu: Replace tmp_adev with hive in amdgpu_pci_slot_reset Ce Sun
2025-04-09 13:32 ` Christian König
  -- strict thread matches above, loose matches on Subject: below --
2025-04-09 13:39 Ce Sun
2025-04-09 13:44 ` Christian König
2025-04-09 13:49 ` Lazar, Lijo
2025-04-09 13:56   ` Dan Carpenter
2025-04-10  8:09     ` Lazar, Lijo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.