drm/amdgpu: Fix code style issue
Subsystems (2)
PATCH 1/1 drm/amdgpu: Fix code style issue
cocci warnings: (new ones prefixed by >>)
Quoted 1 line
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:6088:8-9: Unneeded variable: "r". Return "0" on line 6141
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +5 -13
@@ -6143,14 +6143,14 @@ static void amdgpu_device_recovery_put_reset_lock(struct amdgpu_device *adev,amdgpu_device_unlock_reset_domain (tmp_adev->reset_domain); } -static int amdgpu_device_halt_activities ( +static void amdgpu_device_halt_activities (struct amdgpu_device *adev,struct amdgpu_job *job,struct amdgpu_reset_context *reset_context,struct list_head *device_list,struct amdgpu_hive_info *hive,bool need_emergency_restart) {struct amdgpu_device *tmp_adev =NULL ; -int i, r =0 ; +int i;/* block all schedulers and reset given job's ring */ list_for_each_entry (tmp_adev, device_list, reset_list) {
@@ -6202,8 +6202,6 @@ static int amdgpu_device_halt_activities( }atomic_inc (&tmp_adev->gpu_reset_counter); } - -return r; } static int amdgpu_device_asic_reset(struct amdgpu_device *adev,
@@ -6414,11 +6412,8 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,/* We need to lock reset domain only once both for XGMI and single device */ amdgpu_device_recovery_get_reset_lock (adev, &device_list); - r =amdgpu_device_halt_activities (adev, job, reset_context, &device_list, +amdgpu_device_halt_activities (adev, job, reset_context, &device_list, hive, need_emergency_restart); -if (r) - goto reset_unlock; -if (need_emergency_restart) goto skip_sched_resume;/*
@@ -6830,7 +6825,6 @@ pci_ers_result_t amdgpu_pci_error_detected(struct pci_dev *pdev, pci_channel_stastruct amdgpu_hive_info *hive =amdgpu_get_xgmi_hive (adev);struct amdgpu_reset_context reset_context;struct list_head device_list; -int r =0 ;dev_info (adev->dev,"PCI error: detected callback!!\n" );
@@ -6857,14 +6851,12 @@ pci_ers_result_t amdgpu_pci_error_detected(struct pci_dev *pdev, pci_channel_staamdgpu_device_recovery_prepare (adev, &device_list, hive);amdgpu_device_recovery_get_reset_lock (adev, &device_list); - r =amdgpu_device_halt_activities (adev,NULL , &reset_context, &device_list, - hive, false); +amdgpu_device_halt_activities (adev,NULL , &reset_context, &device_list, + hive, false);if (hive) {mutex_unlock (&hive->hive_lock);amdgpu_put_xgmi_hive (hive); } -if (r) -return PCI_ERS_RESULT_DISCONNECT ;return PCI_ERS_RESULT_NEED_RESET ;case pci_channel_io_perm_failure:/* Permanent error, prepare for device removal */
Signature · 1 line
2.34.1
[AMD Official Use Only - AMD Internal Distribution Only]
Quoted 97 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Ce Sun
Sent: Monday, June 30, 2025 11:02 AM
To: [email protected]
Cc: Lazar, Lijo <[email protected]>; Zhang, Hawking <[email protected]>; Sun, Ce(Overlord) <[email protected]>; kernel test robot <[email protected]>
Subject: [PATCH] drm/amdgpu: Fix code style issuecocci warnings: (new ones prefixed by >>)
Quoted 2 lines
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:6088:8-9: Unneeded
variable: "r". Return "0" on line 6141Reported-by kernel test robot <[email protected]>Signed-off-by Ce Sun <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2
-2@@ -6143,14 +6143,14 @@ static void amdgpu_device_recovery_put_reset_lock(struct amdgpu_device *adev, amdgpu_device_unlock_reset_domain(tmp_adev->reset_domain); } -static int amdgpu_device_halt_activities ( +static void amdgpu_device_halt_activities (struct amdgpu_device *adev,struct amdgpu_job *job,struct amdgpu_reset_context *reset_context,struct list_head *device_list,struct amdgpu_hive_info *hive,bool need_emergency_restart) {struct amdgpu_device *tmp_adev =NULL ; -int i, r =0 ; +int i;/* block all schedulers and reset given job's ring */ list_for_each_entry(tmp_adev, device_list, reset_list) { @@ -6202,8 +6202,6 @@ static int amdgpu_device_halt_activities( } atomic_inc(&tmp_adev->gpu_reset_counter); }drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2
-6- -return r; } static int amdgpu_device_asic_reset(struct amdgpu_device *adev, @@ -6414,11 +6412,8 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev, /* We need to lock reset domain only once both for XGMI and single device */ amdgpu_device_recovery_get_reset_lock(adev, &device_list); - r =amdgpu_device_halt_activities (adev, job, reset_context, &device_list, + amdgpu_device_halt_activities(adev, job, reset_context, &device_list, hive, need_emergency_restart); -if (r) - goto reset_unlock; - if (need_emergency_restart) goto skip_sched_resume;/* @@ -6830,7 +6825,6 @@ pci_ers_result_t amdgpu_pci_error_detected(struct
pci_dev*pdev,pci_channel_stastruct amdgpu_hive_info *hive = amdgpu_get_xgmi_hive(adev); struct amdgpu_reset_context reset_context; struct list_head device_list;drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0
-1-int r =0 ;dev_info (adev->dev,"PCI error: detected callback!!\n" );@@ -6857,14 +6851,12 @@ pci_ers_result_t amdgpu_pci_error_detected(struct
pci_dev*pdev,pci_channel_staamdgpu_device_recovery_prepare(adev, &device_list, hive); amdgpu_device_recovery_get_reset_lock(adev, &device_list);- r = amdgpu_device_halt_activities(adev, NULL,
&reset_context,&device_list,drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-1- hive, false); + amdgpu_device_halt_activities(adev, NULL, &reset_context,
&device_list,drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-3+ hive, false);if (hive) {mutex_unlock (&hive->hive_lock);amdgpu_put_xgmi_hive (hive); } -if (r) -return PCI_ERS_RESULT_DISCONNECT ;return PCI_ERS_RESULT_NEED_RESET ;case pci_channel_io_perm_failure:/* Permanent error, prepare for device removal */ --2.34.1