mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: remove redundant NULL check in amdgpu_cs_vm_handling
@ 2026-09-09  9:37 Jiangshan Yi
  2026-09-09  9:59 ` Christian König
  2026-09-09 16:07 ` Alex Deucher
  0 siblings, 2 replies; 3+ messages in thread
From: Jiangshan Yi @ 2026-09-09  9:37 UTC (permalink / raw)
  To: alexander.deucher, christian.koenig, airlied, simona
  Cc: tvrtko.ursulin, sunil.khatri, vitaly.prosyak,
	pierre-eric.pelloux-prayer, moonafterrain, candice.li, amd-gfx,
	dri-devel, linux-kernel, 13667453960, Jiangshan Yi

bo_va is assigned from fpriv->csa_va, which is already verified to be
non-NULL by the surrounding if statement. The inner NULL check can
therefore never trigger and is dead code, so remove it.

Signed-off-by: Jiangshan Yi <yijiangshan@kylinos.cn>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 03b41f803520..c978f042ae1f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -1146,8 +1146,6 @@ static int amdgpu_cs_vm_handling(struct amdgpu_cs_parser *p)
 
 	if (fpriv->csa_va) {
 		bo_va = fpriv->csa_va;
-		if (!bo_va)
-			return -ENOMEM;
 		r = amdgpu_vm_bo_update(adev, bo_va, false);
 		if (r)
 			return r;
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amdgpu: remove redundant NULL check in amdgpu_cs_vm_handling
  2026-09-09  9:37 [PATCH] drm/amdgpu: remove redundant NULL check in amdgpu_cs_vm_handling Jiangshan Yi
@ 2026-09-09  9:59 ` Christian König
  2026-09-09 16:07 ` Alex Deucher
  1 sibling, 0 replies; 3+ messages in thread
From: Christian König @ 2026-09-09  9:59 UTC (permalink / raw)
  To: Jiangshan Yi, alexander.deucher, airlied, simona
  Cc: tvrtko.ursulin, sunil.khatri, vitaly.prosyak,
	pierre-eric.pelloux-prayer, moonafterrain, candice.li, amd-gfx,
	dri-devel, linux-kernel, 13667453960

On 9/9/26 11:37, Jiangshan Yi wrote:
> bo_va is assigned from fpriv->csa_va, which is already verified to be
> non-NULL by the surrounding if statement. The inner NULL check can
> therefore never trigger and is dead code, so remove it.
> 
> Signed-off-by: Jiangshan Yi <yijiangshan@kylinos.cn>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> index 03b41f803520..c978f042ae1f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> @@ -1146,8 +1146,6 @@ static int amdgpu_cs_vm_handling(struct amdgpu_cs_parser *p)
> 
>         if (fpriv->csa_va) {
>                 bo_va = fpriv->csa_va;
> -               if (!bo_va)
> -                       return -ENOMEM;
>                 r = amdgpu_vm_bo_update(adev, bo_va, false);
>                 if (r)
>                         return r;
> --
> 2.25.1
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amdgpu: remove redundant NULL check in amdgpu_cs_vm_handling
  2026-09-09  9:37 [PATCH] drm/amdgpu: remove redundant NULL check in amdgpu_cs_vm_handling Jiangshan Yi
  2026-09-09  9:59 ` Christian König
@ 2026-09-09 16:07 ` Alex Deucher
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2026-09-09 16:07 UTC (permalink / raw)
  To: Jiangshan Yi
  Cc: alexander.deucher, christian.koenig, airlied, simona,
	tvrtko.ursulin, sunil.khatri, vitaly.prosyak,
	pierre-eric.pelloux-prayer, moonafterrain, candice.li, amd-gfx,
	dri-devel, linux-kernel, 13667453960

Applied.  Thanks!

On Wed, Sep 9, 2026 at 9:05 AM Jiangshan Yi <yijiangshan@kylinos.cn> wrote:
>
> bo_va is assigned from fpriv->csa_va, which is already verified to be
> non-NULL by the surrounding if statement. The inner NULL check can
> therefore never trigger and is dead code, so remove it.
>
> Signed-off-by: Jiangshan Yi <yijiangshan@kylinos.cn>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> index 03b41f803520..c978f042ae1f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> @@ -1146,8 +1146,6 @@ static int amdgpu_cs_vm_handling(struct amdgpu_cs_parser *p)
>
>         if (fpriv->csa_va) {
>                 bo_va = fpriv->csa_va;
> -               if (!bo_va)
> -                       return -ENOMEM;
>                 r = amdgpu_vm_bo_update(adev, bo_va, false);
>                 if (r)
>                         return r;
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-09 16:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-09  9:37 [PATCH] drm/amdgpu: remove redundant NULL check in amdgpu_cs_vm_handling Jiangshan Yi
2026-09-09  9:59 ` Christian König
2026-09-09 16:07 ` Alex Deucher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®