Skip to contentSkip to conversation

drm/amdgpu: fix unsigned error codes

PATCH In review Lang Yu 2 participants 2 messages Sep 6, 2023

Subsystems (2)
lore
Share & tools
lore

Lang Yu

author
#0 lore raw

PATCH 1/1 drm/amdgpu: fix unsigned error codes

Fixes 77b13b916728 ("drm/amdgpu: add selftest framework for UMSCH")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c +3 -4
index 284643e1efeb..9da80b54d63e 100644
@@ -335,11 +335,10 @@ static int setup_umsch_mm_test(struct amdgpu_device *adev,
 	if (r)
 		goto error_free_vm;
 
-	test->pasid = amdgpu_pasid_alloc(16);
-	if (test->pasid < 0) {
-		r = test->pasid;
+	r = amdgpu_pasid_alloc(16);
+	if (r < 0)
 		goto error_fini_vm;
-	}
+	test->pasid = r;
 
 	r = amdgpu_bo_create_kernel(adev, sizeof(struct umsch_mm_test_ctx_data),
 				    PAGE_SIZE, AMDGPU_GEM_DOMAIN_GTT,
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 1/1
#1 lore raw

[AMD Official Use Only - General]

________________________________
From: Yu, Lang <[email protected]>
Sent: Wednesday, September 6, 2023 7:42 AM
To: [email protected] <[email protected]>
Cc: Deucher, Alexander <[email protected]>; Gopalakrishnan, Veerabadhran (Veera) <[email protected]>; Yu, Lang <[email protected]>; Dan Carpenter <[email protected]>
Subject: [PATCH] drm/amdgpu: fix unsigned error codes

Fixes 77b13b916728 ("drm/amdgpu: add selftest framework for UMSCH")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c +3 -4
index 284643e1efeb..9da80b54d63e 100644
@@ -335,11 +335,10 @@ static int setup_umsch_mm_test(struct amdgpu_device *adev,
         if (r)
                 goto error_free_vm;
 
-       test->pasid = amdgpu_pasid_alloc(16);
-       if (test->pasid < 0) {
-               r = test->pasid;
+       r = amdgpu_pasid_alloc(16);
+       if (r < 0)
                 goto error_fini_vm;
-       }
+       test->pasid = r;
 
         r = amdgpu_bo_create_kernel(adev, sizeof(struct umsch_mm_test_ctx_data),
                                     PAGE_SIZE, AMDGPU_GEM_DOMAIN_GTT,

--
2.25.1