drm/amd/display: Fix wrongly passed static prefix
Subsystems (3)
PATCH 1/1 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.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c +2 -2
@@ -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 */
Signature · 6 lines
2.16.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): [email protected]
Harry Wentland
Reviewed-byQuoted 7 lines · Takashi Iwai
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.
Quoted 6 lines
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 62d591a8e00c ("drm/amd/display: create new files for hubbub functions")Signed-off-by Takashi Iwai <[email protected]>
Harry
Quoted 10 lines
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c +0
-0
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c bool hubbub1_verify_allow_pstate_change_high( · line 135
Quoted 10 lines
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c +2
-2@@ -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 */
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 13 lines · Harry Wentland
Quoted 11 lines · Takashi Iwai
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.
Quoted 6 lines
Quoted 2 lines
Fixes 62d591a8e00c ("drm/amd/display: create new files for hubbub functions")Signed-off-by Takashi Iwai <[email protected]>Reviewed-by Harry Wentland <[email protected]>Harry
This patch seems forgotten? The compile warning is still present in the latest for-next.
thanks,
Takashi
Quoted 5 lines
Quoted 5 lines
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 17 lines
Quoted 6 lines
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c +0
-0drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c bool hubbub1_verify_allow_pstate_change_high( · line 135
Quoted 10 lines
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c +2
-2@@ -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 */
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 19 lines · Takashi Iwai
Quoted 16 lines · Harry Wentland
Quoted 13 lines · Takashi Iwai
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 62d591a8e00c ("drm/amd/display: create new files for hubbub functions")Signed-off-by Takashi Iwai <[email protected]>
Quoted 7 lines
Quoted 3 lines
Reviewed-by Harry Wentland <[email protected]>Harry
This patch seems forgotten? The compile warning is still present in the latest for-next.
Sorry, totally missed this one. Applied.
Alex
Quoted 27 lines
thanks,
Takashi
Quoted 5 lines
Quoted 5 lines
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)Quoted 17 lines
Quoted 6 lines
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c +0
-0drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c bool hubbub1_verify_allow_pstate_change_high( · line 135
Quoted 10 lines
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c +2
-2@@ -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 */
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx