Skip to contentSkip to conversation

drm/amdgpu/jpeg: remove redundant check when it returns

PATCH In review Leo Liu 4 participants 5 messages Aug 13, 2020 – Aug 14, 2020

Subsystems (2)
lore
Share & tools
lore

Leo Liu

author
#0 lore raw

PATCH 1/1 drm/amdgpu/jpeg: remove redundant check when it returns

Fix warning from kernel test robot

---
 drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c +0 -2
index c41e5590a701..f4ba423af051 100644
@@ -465,8 +465,6 @@ static int jpeg_v3_0_wait_for_idle(void *handle)
 	ret = SOC15_WAIT_ON_RREG(JPEG, 0, mmUVD_JRBC_STATUS,
 		UVD_JRBC_STATUS__RB_JOB_DONE_MASK,
 		UVD_JRBC_STATUS__RB_JOB_DONE_MASK);
-	if (ret)
-		return ret;
 
 	return ret;
 }
Signature · 6 lines
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
maintainer Reviewed-by on v1 1/1
#1 lore raw

[AMD Public Use]

________________________________
From: amd-gfx <[email protected]> on behalf of Leo Liu <[email protected]>
Sent: Thursday, August 13, 2020 3:40 PM
To: [email protected] <[email protected]>
Cc: Liu, Leo <[email protected]>
Subject: [PATCH] drm/amdgpu/jpeg: remove redundant check when it returns

Fix warning from kernel test robot

---
 drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c +0 -2
index c41e5590a701..f4ba423af051 100644
@@ -465,8 +465,6 @@ static int jpeg_v3_0_wait_for_idle(void *handle)
         ret = SOC15_WAIT_ON_RREG(JPEG, 0, mmUVD_JRBC_STATUS,
                 UVD_JRBC_STATUS__RB_JOB_DONE_MASK,
                 UVD_JRBC_STATUS__RB_JOB_DONE_MASK);
-       if (ret)
-               return ret;
 
         return ret;
 }

--
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Calexander.deucher%40amd.com%7C3024a7a58bf24bc3731b08d83fc0df59%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637329444922074471&amp;sdata=VqEE7z0JlPSNE0nH3HFISbRGPF7tC0uNgBB3yJnSSHo%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#2 lore raw
In reply to Leo Liu

Am 13.08.20 um 21:40 schrieb Leo Liu:

Quoted 12 lines

Fix warning from kernel test robot

---
  drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c | 2 --
  1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c +0 -0
index c41e5590a701..f4ba423af051 100644

drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c static int jpeg_v3_0_wait_for_idle(void *handle) · line 469

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c +0 -2
@@ -465,8 +465,6 @@ static int jpeg_v3_0_wait_for_idle(void *handle)
  	ret = SOC15_WAIT_ON_RREG(JPEG, 0, mmUVD_JRBC_STATUS,
  		UVD_JRBC_STATUS__RB_JOB_DONE_MASK,
  		UVD_JRBC_STATUS__RB_JOB_DONE_MASK);
-	if (ret)
-		return ret;
 
  	return ret;

You will probably get the next warning from the test robot with that because it can be simplified to "return SOC15_"...

Maybe even the local variable ret can be dropped, depending on what else it is used for in the function.

Christian.

drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c static int jpeg_v3_0_wait_for_idle(void *handle) · line 470

Quoted 1 line
drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c +0 -0
  }

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

author
#3 lore raw

PATCH 1/1 drm/amdgpu/jpeg: remove redundant check when it returns

In reply to Leo Liu

Fix warning from kernel test robot
v2: remove the local variable as well

---
 drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c +1 -6
index c41e5590a701..3a0dff53654d 100644
@@ -460,15 +460,10 @@ static bool jpeg_v3_0_is_idle(void *handle)
 static int jpeg_v3_0_wait_for_idle(void *handle)
 {
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
-	int ret;
 
-	ret = SOC15_WAIT_ON_RREG(JPEG, 0, mmUVD_JRBC_STATUS,
+	return SOC15_WAIT_ON_RREG(JPEG, 0, mmUVD_JRBC_STATUS,
 		UVD_JRBC_STATUS__RB_JOB_DONE_MASK,
 		UVD_JRBC_STATUS__RB_JOB_DONE_MASK);
-	if (ret)
-		return ret;
-
-	return ret;
 }
 
 static int jpeg_v3_0_set_clockgating_state(void *handle,
Signature · 6 lines
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Acked-by Nirmoy Das on v1 1/1
#4 lore raw
Quoted 20 lines · Leo Liu

Fix warning from kernel test robot
v2: remove the local variable as well

---
  drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c | 7 +------
  1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c +0 -2
index c41e5590a701..3a0dff53654d 100644
@@ -460,15 +460,10 @@ static bool jpeg_v3_0_is_idle(void *handle)
  static int jpeg_v3_0_wait_for_idle(void *handle)
  {
  	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
-	int ret;
 
-	ret = SOC15_WAIT_ON_RREG(JPEG, 0, mmUVD_JRBC_STATUS,

drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c static bool jpeg_v3_0_is_idle(void *handle) · line 469

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c +1 -4
+	return SOC15_WAIT_ON_RREG(JPEG, 0, mmUVD_JRBC_STATUS,
  		UVD_JRBC_STATUS__RB_JOB_DONE_MASK,
  		UVD_JRBC_STATUS__RB_JOB_DONE_MASK);
-	if (ret)
-		return ret;
-
-	return ret;
  }
 
  static int jpeg_v3_0_set_clockgating_state(void *handle,

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx