提交 fa1d7297 编写于 作者: T Takashi Iwai 提交者: Alex Deucher

drm/amd/display: Fix wrongly passed static prefix

Currently, gcc spews a warning as:
  drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hubbub.c: In function ‘hubbub1_verify_allow_pstate_change_high’:
  ./include/drm/drm_print.h:316:2: warning: ‘debug_data’ may be used uninitialized in this function [-Wmaybe-uninitialized]

This is because the code checks against a static value although it's
basically a constant and guaranteed to be set.

This patch changes the type prefix from static to const for addressing
the compile warning above and also for letting the compiler optimize
better.

Fixes: 62d591a8 ("drm/amd/display: create new files for hubbub functions")
Reviewed-by: NHarry Wentland <harry.wentland@amd.com>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 6d220a7e
......@@ -128,8 +128,8 @@ bool hubbub1_verify_allow_pstate_change_high(
* pstate takes around ~100us on linux. Unknown currently as to
* why it takes that long on linux
*/
static unsigned int pstate_wait_timeout_us = 200;
static unsigned int pstate_wait_expected_timeout_us = 40;
const unsigned int pstate_wait_timeout_us = 200;
const unsigned int pstate_wait_expected_timeout_us = 40;
static unsigned int max_sampled_pstate_wait_us; /* data collection */
static bool forced_pstate_allow; /* help with revert wa */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册