amdgpu/amdgpu_psp: remove unneeded ret variable
Subsystems (2)
PATCH 1/1 amdgpu/amdgpu_psp: remove unneeded ret variable
From: Minghao Chi <[email protected]>
Return value from amdgpu_bo_create_kernel() directly instead of taking this in another redundant variable.
Reported-by Zeal Robot <[email protected]>
Signed-off-by Minghao Chi <[email protected]>
Signed-off-by CGEL ZTE <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1 -5
@@ -914,19 +914,15 @@ static void psp_prep_ta_load_cmd_buf(struct psp_gfx_cmd_resp *cmd,static int psp_ta_init_shared_buf (struct psp_context *psp,struct ta_mem_context *mem_ctx) { -int ret; -/* * Allocate 16k memory aligned to 4k from Frame Buffer (local * physical) for ta to host memory */ - ret =amdgpu_bo_create_kernel (psp->adev, mem_ctx->shared_mem_size, +return amdgpu_bo_create_kernel (psp->adev, mem_ctx->shared_mem_size,PAGE_SIZE ,AMDGPU_GEM_DOMAIN_VRAM , &mem_ctx->shared_bo, &mem_ctx->shared_mc_addr, &mem_ctx->shared_buf); - -return ret; }static void psp_ta_free_shared_buf (struct ta_mem_context *mem_ctx)
Signature · 1 line
2.25.1
Alex Deucher
AppliedApplied. Thanks!
Alex
Quoted 41 lines · On Tue, Jan 18, 2022 at 2:57 AM <[email protected]> wrote:
From: Minghao Chi <[email protected]>
Return value from
amdgpu_bo_create_kernel()directly instead of taking this in another redundant variable.Reported-by Zeal Robot <[email protected]>Signed-off-by Minghao Chi <[email protected]>Signed-off-by CGEL ZTE <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1
-6@@ -914,19 +914,15 @@ static void psp_prep_ta_load_cmd_buf(struct psp_gfx_cmd_resp *cmd,static int psp_ta_init_shared_buf (struct psp_context *psp,struct ta_mem_context *mem_ctx) { -int ret; -/* * Allocate 16k memory aligned to 4k from Frame Buffer (local * physical) for ta to host memory */ - ret =amdgpu_bo_create_kernel (psp->adev, mem_ctx->shared_mem_size, +return amdgpu_bo_create_kernel (psp->adev, mem_ctx->shared_mem_size,PAGE_SIZE ,AMDGPU_GEM_DOMAIN_VRAM , &mem_ctx->shared_bo, &mem_ctx->shared_mc_addr, &mem_ctx->shared_buf); - -return ret; }static void psp_ta_free_shared_buf (struct ta_mem_context *mem_ctx) --2.25.1