[PATCH -next] drm/amd/display: Remove the redundant else if branch in the function amdgpu_dm_init()
Jiapeng Chong
jiapeng.chong at linux.alibaba.com
Thu Aug 29 02:36:54 UTC 2024
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.
./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 at linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9829
Signed-off-by: Jiapeng Chong <jiapeng.chong at linux.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
More information about the amd-gfx
mailing list