aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWeiguo Li <[email protected]>2022-03-03 00:17:39 +0800
committerAlex Deucher <[email protected]>2022-03-02 18:40:07 -0500
commit3192f1d9b61a59d7c82fef187bffa7281fbdc9f5 (patch)
treee034c3791780c16625466aa08e89b93fa1b5b7f1
parent825e0af0d453f18bb84feb40bff447cf59d61979 (diff)
drm/amdgpu: remove redundant null check
Remove the redundant null check since the caller ensures that 'ctx' is never NULL. Reviewed-by: Christian König <[email protected]> Signed-off-by: Weiguo Li <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
index 4294f17cedcb..2d2dceab4c39 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
@@ -262,9 +262,6 @@ static int amdgpu_ctx_get_stable_pstate(struct amdgpu_ctx *ctx,
struct amdgpu_device *adev = ctx->adev;
enum amd_dpm_forced_level current_level;
- if (!ctx)
- return -EINVAL;
-
current_level = amdgpu_dpm_get_performance_level(adev);
switch (current_level) {
@@ -294,9 +291,6 @@ static int amdgpu_ctx_set_stable_pstate(struct amdgpu_ctx *ctx,
enum amd_dpm_forced_level level;
int r;
- if (!ctx)
- return -EINVAL;
-
mutex_lock(&adev->pm.stable_pstate_ctx_lock);
if (adev->pm.stable_pstate_ctx && adev->pm.stable_pstate_ctx != ctx) {
r = -EBUSY;