]> Git Repo - linux.git/blobdiff - drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
Merge tag 'core-entry-2021-04-26' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_xgmi.c
index 541ef6be390f09d0bfe55872acb9ed39b8ef6284..659b385b27b5a04ca02b9e2a1f7b450ab1a41168 100644 (file)
@@ -324,7 +324,7 @@ static void amdgpu_xgmi_sysfs_rem_dev_info(struct amdgpu_device *adev,
 
 struct amdgpu_hive_info *amdgpu_get_xgmi_hive(struct amdgpu_device *adev)
 {
-       struct amdgpu_hive_info *hive = NULL, *tmp = NULL;
+       struct amdgpu_hive_info *hive = NULL;
        int ret;
 
        if (!adev->gmc.xgmi.hive_id)
@@ -337,11 +337,9 @@ struct amdgpu_hive_info *amdgpu_get_xgmi_hive(struct amdgpu_device *adev)
 
        mutex_lock(&xgmi_mutex);
 
-       if (!list_empty(&xgmi_hive_list)) {
-               list_for_each_entry_safe(hive, tmp, &xgmi_hive_list, node)  {
-                       if (hive->hive_id == adev->gmc.xgmi.hive_id)
-                               goto pro_end;
-               }
+       list_for_each_entry(hive, &xgmi_hive_list, node)  {
+               if (hive->hive_id == adev->gmc.xgmi.hive_id)
+                       goto pro_end;
        }
 
        hive = kzalloc(sizeof(*hive), GFP_KERNEL);
This page took 0.035884 seconds and 4 git commands to generate.