Skip to contentSkip to conversation

amdgpu: remove unreachable code

PATCH Applied Jiapeng Chong 3 participants 3 messages May 28, 2021 – Jun 2, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 amdgpu: remove unreachable code

In the function amdgpu_uvd_cs_msg(), every branch in the switch statement will have a return, so the code below the switch statement will not be executed.

Eliminate the follow smatch warning:

drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:845 amdgpu_uvd_cs_msg() warn:
ignoring unreachable code.

---
Changes in v2:
-For the follow advice: https://lore.kernel.org/patchwork/patch/1435968/

 drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +1 -2
index c6dbc08..35f6874 100644
@@ -829,9 +829,8 @@ static int amdgpu_uvd_cs_msg(struct amdgpu_uvd_cs_ctx *ctx,
 
 	default:
 		DRM_ERROR("Illegal UVD message type (%d)!\n", msg_type);
-		return -EINVAL;
 	}
-	BUG();
+
 	return -EINVAL;
 }
 
Signature · 1 line
1.8.3.1
maintainer Reviewed-by on v3 1/1
#1 lore raw

Am 28.05.21 um 11:29 schrieb Jiapeng Chong:

Quoted 11 lines

In the function amdgpu_uvd_cs_msg(), every branch in the switch statement will have a return, so the code below the switch statement will not be executed.

Eliminate the follow smatch warning:

drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:845 amdgpu_uvd_cs_msg() warn:
ignoring unreachable code.

Quoted 12 lines

---
Changes in v2:
-For the follow advice: https://lore.kernel.org/patchwork/patch/1435968/

  drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +0 -0
index c6dbc08..35f6874 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c static int amdgpu_uvd_cs_msg(struct amdgpu_uvd_cs_ctx *ctx, · line 836

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +1 -2
@@ -829,9 +829,8 @@ static int amdgpu_uvd_cs_msg(struct amdgpu_uvd_cs_ctx *ctx,
 
  	default:
  		DRM_ERROR("Illegal UVD message type (%d)!\n", msg_type);
-		return -EINVAL;
  	}
-	BUG();
+
  	return -EINVAL;
  }
 

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

Applied
#2 lore raw

Applied. Thanks!

Quoted 43 lines · Christian König

Am 28.05.21 um 11:29 schrieb Jiapeng Chong:

Quoted 11 lines

In the function amdgpu_uvd_cs_msg(), every branch in the switch statement will have a return, so the code below the switch statement will not be executed.

Eliminate the follow smatch warning:

drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:845 amdgpu_uvd_cs_msg() warn:
ignoring unreachable code.

Quoted 12 lines

---
Changes in v2:
-For the follow advice: https://lore.kernel.org/patchwork/patch/1435968/

  drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +0 -0
index c6dbc08..35f6874 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c static int amdgpu_uvd_cs_msg(struct amdgpu_uvd_cs_ctx *ctx, · line 836

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +1 -2
@@ -829,9 +829,8 @@ static int amdgpu_uvd_cs_msg(struct amdgpu_uvd_cs_ctx *ctx,
 
      default:
              DRM_ERROR("Illegal UVD message type (%d)!\n", msg_type);
-             return -EINVAL;
      }
-     BUG();
+
      return -EINVAL;
  }
 

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