Skip to contentSkip to conversation

drm/amdgpu/userq: dont use goto to jump when at end of function

PATCH In review Sunil Khatri 3 participants 4 messages Mar 24

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu/userq: dont use goto to jump when at end of function

In function amdgpu_userq_restore_worker we dont need to use goto as we already in the end of function and it will exit naturally.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +1 -3
index eb07ed078bfa..a351383b432b 100644
@@ -1227,10 +1227,8 @@ static void amdgpu_userq_restore_worker(struct work_struct *work)
 	}
 
 	ret = amdgpu_userq_restore_all(uq_mgr);
-	if (ret) {
+	if (ret)
 		drm_file_err(uq_mgr->file, "Failed to restore all queues\n");
-		goto unlock;
-	}
 
 unlock:
 	mutex_unlock(&uq_mgr->userq_mutex);
Signature · 1 line
2.34.1
#1 lore raw

[AMD Official Use Only - AMD Internal Distribution Only]

Ping!

Get Outlook for iOS<https://aka.ms/o0ukef>
________________________________
From: Sunil Khatri <[email protected]>
Sent: Tuesday, March 24, 2026 1:21:49 PM
To: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>
Cc: [email protected] <[email protected]>; Khatri, Sunil <[email protected]>
Subject: [Patch v1] drm/amdgpu/userq: dont use goto to jump when at end of function

In function amdgpu_userq_restore_worker we dont need to use goto as we already in the end of function and it will exit naturally.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +1 -3
index eb07ed078bfa..a351383b432b 100644
@@ -1227,10 +1227,8 @@ static void amdgpu_userq_restore_worker(struct work_struct *work)
         }
 
         ret = amdgpu_userq_restore_all(uq_mgr);
-       if (ret) {
+       if (ret)
                 drm_file_err(uq_mgr->file, "Failed to restore all queues\n");
-               goto unlock;
-       }
 
 unlock:
         mutex_unlock(&uq_mgr->userq_mutex);

--
2.34.1

maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Sunil Khatri
Quoted 5 lines · Sunil Khatri

In function amdgpu_userq_restore_worker we dont need to use goto as we already in the end of function and it will exit naturally.

Quoted 20 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +1 -3
index eb07ed078bfa..a351383b432b 100644
@@ -1227,10 +1227,8 @@ static void amdgpu_userq_restore_worker(struct work_struct *work)
 	}
 
 	ret = amdgpu_userq_restore_all(uq_mgr);
-	if (ret) {
+	if (ret)
 		drm_file_err(uq_mgr->file, "Failed to restore all queues\n");
-		goto unlock;
-	}
 
 unlock:
 	mutex_unlock(&uq_mgr->userq_mutex);
Reviewed-by on v1 1/1
#3 lore raw
In reply to Sunil Khatri
Quoted 6 lines · Sunil Khatri

In function amdgpu_userq_restore_worker we dont need to use goto as we already in the end of function and it will exit naturally.

Quoted 23 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +1 -4
index eb07ed078bfa..a351383b432b 100644
@@ -1227,10 +1227,8 @@ static void amdgpu_userq_restore_worker(struct work_struct *work)
        }
 
        ret = amdgpu_userq_restore_all(uq_mgr);
-       if (ret) {
+       if (ret)
                drm_file_err(uq_mgr->file, "Failed to restore all queues\n");
-               goto unlock;
-       }
 
 unlock:
        mutex_unlock(&uq_mgr->userq_mutex);
--

2.34.1