2022-08-23 06:58:32

by 赵军奎

[permalink] [raw]
Subject: [PATCH] drm/amd: remove possible condition with no effect (if == else)

This patch fix cocci warning:
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c:1816:6-8:
WARNING: possible condition with no effect (if == else).

Signed-off-by: Bernard Zhao <[email protected]>
---
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c b/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c
index 85f32206a766..dccc9794e6a2 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c
@@ -1813,8 +1813,6 @@ static bool dcn314_resource_construct(

if (dc->ctx->dce_environment == DCE_ENV_PRODUCTION_DRV)
dc->debug = debug_defaults_drv;
- else if (dc->ctx->dce_environment == DCE_ENV_FPGA_MAXIMUS)
- dc->debug = debug_defaults_diags;
else
dc->debug = debug_defaults_diags;
// Init the vm_helper
--
2.33.1


2022-08-25 16:16:16

by Alex Deucher

[permalink] [raw]
Subject: Re: [PATCH] drm/amd: remove possible condition with no effect (if == else)

Applied. Thanks!

On Tue, Aug 23, 2022 at 3:30 AM Bernard Zhao <[email protected]> wrote:
>
> This patch fix cocci warning:
> drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c:1816:6-8:
> WARNING: possible condition with no effect (if == else).
>
> Signed-off-by: Bernard Zhao <[email protected]>
> ---
> drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c b/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c
> index 85f32206a766..dccc9794e6a2 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c
> @@ -1813,8 +1813,6 @@ static bool dcn314_resource_construct(
>
> if (dc->ctx->dce_environment == DCE_ENV_PRODUCTION_DRV)
> dc->debug = debug_defaults_drv;
> - else if (dc->ctx->dce_environment == DCE_ENV_FPGA_MAXIMUS)
> - dc->debug = debug_defaults_diags;
> else
> dc->debug = debug_defaults_diags;
> // Init the vm_helper
> --
> 2.33.1
>