[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADnq5_Na=-KTEOJT6y8EzQdk_wewFBGs5Or1j5bfVA1wO0PTCA@mail.gmail.com>
Date: Thu, 29 Aug 2024 17:37:22 -0400
From: Alex Deucher <alexdeucher@...il.com>
To: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
Cc: harry.wentland@....com, sunpeng.li@....com, Rodrigo.Siqueira@....com,
alexander.deucher@....com, christian.koenig@....com, Xinhui.Pan@....com,
airlied@...il.com, daniel@...ll.ch, amd-gfx@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
Abaci Robot <abaci@...ux.alibaba.com>
Subject: Re: [PATCH -next] drm/amd/display: Remove the redundant else if
branch in the function amdgpu_dm_init()
On Wed, Aug 28, 2024 at 10:37 PM Jiapeng Chong
<jiapeng.chong@...ux.alibaba.com> wrote:
>
> The assignment of the else and if else branches is the same, so we
> remove it and add comments here to make the code easier to understand.
I think the code is clearer as is. If you force IPS on, you want to
make sure it's enabled, regardless of what the default ends up being
in the else case.
Alex
>
> ./drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:1871:6-8: WARNING: possible condition with no effect (if == else).
>
> Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9829
> Signed-off-by: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index e14c0c060e1b..71624917c475 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -1868,9 +1868,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
> init_data.flags.disable_ips = DMUB_IPS_DISABLE_DYNAMIC;
> else if (amdgpu_dc_debug_mask & DC_DISABLE_IPS2_DYNAMIC)
> init_data.flags.disable_ips = DMUB_IPS_RCG_IN_ACTIVE_IPS2_IN_OFF;
> - else if (amdgpu_dc_debug_mask & DC_FORCE_IPS_ENABLE)
> - init_data.flags.disable_ips = DMUB_IPS_ENABLE;
> - else
> + else /* The branch cover "else if (amdgpu_dc_debug_mask & DC_FORCE_IPS_ENABLE)" */
> init_data.flags.disable_ips = DMUB_IPS_ENABLE;
>
> init_data.flags.disable_ips_in_vpb = 0;
> --
> 2.32.0.3.g01195cf9f
>
Powered by blists - more mailing lists