[bug report] drm/amd/display: Add SubVP required code

Dan Carpenter dan.carpenter at oracle.com
Mon Aug 1 14:54:28 UTC 2022


Hello Alvin Lee,

The patch 85f4bc0c333c: "drm/amd/display: Add SubVP required code"
from May 2, 2022, leads to the following Smatch static checker
warning:

	drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn32/dcn32_clk_mgr_smu_msg.c:103 dcn32_smu_send_cab_for_uclk_message()
	warn: was shift intended here '(num_ways > 0)'

drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn32/dcn32_clk_mgr_smu_msg.c
    101 void dcn32_smu_send_cab_for_uclk_message(struct clk_mgr_internal *clk_mgr, unsigned int num_ways)
    102 {
--> 103         uint32_t param = (num_ways << 1) | (num_ways > 0);

What is happening here?  It might be more readable as?

	uint32_t param = (num_ways << 1) | (num_ways != 0);

Still confusing actually...

    104 
    105         dcn32_smu_send_msg_with_param(clk_mgr, DALSMC_MSG_SetCabForUclkPstate, param, NULL);
    106         smu_print("Numways for SubVP : %d\n", num_ways);
    107 }

regards,
dan carpenter


More information about the amd-gfx mailing list