drm/amd/display: Simplify bool comparison
Subsystems (3)
PATCH 1/1 drm/amd/display: Simplify bool comparison
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 <[email protected]>
Signed-off-by Jiapeng Chong <[email protected]>
--- drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr_internal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr_internal.h +2 -2
@@ -309,9 +309,9 @@ static inline bool should_set_clock(bool safe_to_lower, int calc_clk, int cur_clstatic 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; }
Signature · 6 lines
1.8.3.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Alex Deucher
AppliedApplied. Thanks!
Alex
Quoted 31 lines · Jiapeng Chong
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 <[email protected]>Signed-off-by Jiapeng Chong <[email protected]>--- drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr_internal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr_internal.h +2
-3@@ -309,9 +309,9 @@ static inline bool should_set_clock(bool safe_to_lower, int calc_clk, int cur_clstatic 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; } --1.8.3.1
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel