[PATCH] drm/amd/display: fix comparison pointer to bool warning in dc.c

Alex Deucher alexdeucher at gmail.com
Mon Jan 4 17:19:25 UTC 2021


On Tue, Dec 29, 2020 at 4:42 AM Tian Tao <tiantao6 at hisilicon.com> wrote:
>
> Fixes coccicheck warning:
> drivers/gpu/drm/amd/display/dc/core/dc.c:1543:12-19: WARNING: Comparison
> to bool
> drivers/gpu/drm/amd/display/dc/core/dc.c:1496:14-42: WARNING: Comparison
> to bool
> drivers/gpu/drm/amd/display/dc/core/dc.c:971:15-48: WARNING: Comparison
> to bool
> drivers/gpu/drm/amd/display/dc/core/dc.c:976:15-44: WARNING: Comparison
> to bool
>
> Signed-off-by: Tian Tao <tiantao6 at hisilicon.com>

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/dc/core/dc.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
> index 58eb0d6..ea28b75 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
> @@ -968,12 +968,12 @@ struct dc *dc_create(const struct dc_init_data *init_params)
>                 goto alloc_fail;
>
>         if (init_params->dce_environment == DCE_ENV_VIRTUAL_HW) {
> -               if (false == dc_construct_ctx(dc, init_params)) {
> +               if (!dc_construct_ctx(dc, init_params)) {
>                         dc_destruct(dc);
>                         goto construct_fail;
>                 }
>         } else {
> -               if (false == dc_construct(dc, init_params)) {
> +               if (!dc_construct(dc, init_params)) {
>                         dc_destruct(dc);
>                         goto construct_fail;
>                 }
> @@ -1493,7 +1493,7 @@ bool dc_commit_state(struct dc *dc, struct dc_state *context)
>         enum dc_status result = DC_ERROR_UNEXPECTED;
>         int i;
>
> -       if (false == context_changed(dc, context))
> +       if (!context_changed(dc, context))
>                 return DC_OK;
>
>         DC_LOG_DC("%s: %d streams\n",
> @@ -1540,7 +1540,7 @@ bool dc_acquire_release_mpc_3dlut(
>                 if (found_pipe_idx) {
>                         if (acquire && pool->funcs->acquire_post_bldn_3dlut)
>                                 ret = pool->funcs->acquire_post_bldn_3dlut(res_ctx, pool, mpcc_id, lut, shaper);
> -                       else if (acquire == false && pool->funcs->release_post_bldn_3dlut)
> +                       else if (!acquire && pool->funcs->release_post_bldn_3dlut)
>                                 ret = pool->funcs->release_post_bldn_3dlut(res_ctx, pool, lut, shaper);
>                 }
>         }
> --
> 2.7.4
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel


More information about the dri-devel mailing list