Changed the control flow to use break statements instead of goto to exit loops when a busy user queue is detected.
Fixes the below: drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c:2751 amdgpu_runtime_idle_check_userq() warn: ignoring unreachable code. Cc: Alex Deucher <alexander.deuc...@amd.com> Cc: Christian König <christian.koe...@amd.com> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmu...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index b9a1ef343c79..801603510d56 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -2749,13 +2749,17 @@ static int amdgpu_runtime_idle_check_userq(struct device *dev) mutex_lock(&adev->userq_mutex); list_for_each_entry_safe(uqm, tmp, &adev->userq_mgr_list, list) { idr_for_each_entry(&uqm->userq_idr, queue, queue_id) { + /* Found an active user queue */ ret = -EBUSY; - goto done; + break; } + if (ret == -EBUSY) + /* Exit the outer loop if busyness is found */ + break; } -done: mutex_unlock(&adev->userq_mutex); + /* Return -EBUSY if any user queue was found, otherwise 0 */ return ret; } -- 2.34.1