drm/amd/display: Simplify bool comparison
authorJiapeng Chong <jiapeng.chong@linux.alibaba.com>
Mon, 8 Feb 2021 10:29:28 +0000 (18:29 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 9 Feb 2021 20:49:42 +0000 (15:49 -0500)
Fix the following coccicheck warning:

./drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr_internal.h:319:11-23:
WARNING: Comparison to bool.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr_internal.h

index ffd3769..316301f 100644 (file)
@@ -309,9 +309,9 @@ static inline bool should_set_clock(bool safe_to_lower, int calc_clk, int cur_cl
 static inline bool should_update_pstate_support(bool safe_to_lower, bool calc_support, bool cur_support)
 {
        if (cur_support != calc_support) {
-               if (calc_support == true && safe_to_lower)
+               if (calc_support && safe_to_lower)
                        return true;
-               else if (calc_support == false && !safe_to_lower)
+               else if (!calc_support && !safe_to_lower)
                        return true;
        }