[PATCH 1/1] drm/amdkfd: Fix variable set but not used warning

Kasiviswanathan, Harish Harish.Kasiviswanathan at amd.com
Fri Jan 28 14:46:00 UTC 2022


[AMD Official Use Only]

Reviewed-By: Harish Kasiviswanathan <Harish.Kasiviswanathan at amd.com>

-----Original Message-----
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Philip Yang
Sent: Friday, January 28, 2022 9:39 AM
To: amd-gfx at lists.freedesktop.org
Cc: Yang, Philip <Philip.Yang at amd.com>
Subject: [PATCH 1/1] drm/amdkfd: Fix variable set but not used warning

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_svm.c: In function
'svm_range_deferred_list_work':
>> drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_svm.c:2067:22: warning:
variable 'p' set but not used [-Wunused-but-set-variable]
    2067 |  struct kfd_process *p;
         |

Fixes: 8b633bdc86671("drm/amdkfd: Ensure mm remain valid in svm deferred_list work")

Reported-by: kernel test robot <lkp at intel.com>
Signed-off-by: Philip Yang <Philip.Yang at amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
index 649c1d2b9607..9a509ec8c327 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
@@ -2079,13 +2079,10 @@ static void svm_range_deferred_list_work(struct work_struct *work)
 	struct svm_range_list *svms;
 	struct svm_range *prange;
 	struct mm_struct *mm;
-	struct kfd_process *p;
 
 	svms = container_of(work, struct svm_range_list, deferred_list_work);
 	pr_debug("enter svms 0x%p\n", svms);
 
-	p = container_of(svms, struct kfd_process, svms);
-
 	spin_lock(&svms->deferred_list_lock);
 	while (!list_empty(&svms->deferred_range_list)) {
 		prange = list_first_entry(&svms->deferred_range_list,
--
2.17.1


More information about the amd-gfx mailing list