* [PATCH] drm/amd/display: Fix wrongly passed static prefix
@ 2019-11-28 8:27 ` Takashi Iwai
0 siblings, 0 replies; 6+ messages in thread
From: Takashi Iwai @ 2019-11-28 8:27 UTC (permalink / raw)
To: Harry Wentland
Cc: Leo Li, Alex Deucher, Christian König,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, David Zhou
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 <tiwai@suse.de>
---
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c
index a02c10e23e0d..b5c44c3bdb98 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c
@@ -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 */
--
2.16.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] drm/amd/display: Fix wrongly passed static prefix
@ 2019-11-28 8:27 ` Takashi Iwai
0 siblings, 0 replies; 6+ messages in thread
From: Takashi Iwai @ 2019-11-28 8:27 UTC (permalink / raw)
To: Harry Wentland
Cc: Leo Li, Alex Deucher, Christian König, amd-gfx, David Zhou
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 <tiwai@suse.de>
---
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c
index a02c10e23e0d..b5c44c3bdb98 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c
@@ -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 */
--
2.16.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/amd/display: Fix wrongly passed static prefix
@ 2019-11-28 14:35 ` Harry Wentland
0 siblings, 0 replies; 6+ messages in thread
From: Harry Wentland @ 2019-11-28 14:35 UTC (permalink / raw)
To: Takashi Iwai, Harry Wentland
Cc: Leo Li, Alex Deucher, Christian König,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, David Zhou
On 2019-11-28 3:27 a.m., Takashi Iwai wrote:
> 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 <tiwai@suse.de>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Harry
> ---
> drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c
> index a02c10e23e0d..b5c44c3bdb98 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c
> @@ -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
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/amd/display: Fix wrongly passed static prefix
@ 2019-11-28 14:35 ` Harry Wentland
0 siblings, 0 replies; 6+ messages in thread
From: Harry Wentland @ 2019-11-28 14:35 UTC (permalink / raw)
To: Takashi Iwai, Harry Wentland
Cc: Leo Li, Alex Deucher, Christian König, amd-gfx, David Zhou
On 2019-11-28 3:27 a.m., Takashi Iwai wrote:
> 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 <tiwai@suse.de>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Harry
> ---
> drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c
> index a02c10e23e0d..b5c44c3bdb98 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c
> @@ -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
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/amd/display: Fix wrongly passed static prefix
2019-11-28 14:35 ` Harry Wentland
(?)
@ 2020-02-05 16:55 ` Takashi Iwai
2020-02-05 19:24 ` Alex Deucher
-1 siblings, 1 reply; 6+ messages in thread
From: Takashi Iwai @ 2020-02-05 16:55 UTC (permalink / raw)
To: Harry Wentland
Cc: David Zhou, Leo Li, amd-gfx, Alex Deucher, Harry Wentland,
Christian K6nig
On Thu, 28 Nov 2019 15:35:23 +0100,
Harry Wentland wrote:
>
> On 2019-11-28 3:27 a.m., Takashi Iwai wrote:
> > 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 <tiwai@suse.de>
>
> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
>
> Harry
This patch seems forgotten? The compile warning is still present in
the latest for-next.
thanks,
Takashi
>
> > ---
> > drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c
> > index a02c10e23e0d..b5c44c3bdb98 100644
> > --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c
> > +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c
> > @@ -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
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/amd/display: Fix wrongly passed static prefix
2020-02-05 16:55 ` Takashi Iwai
@ 2020-02-05 19:24 ` Alex Deucher
0 siblings, 0 replies; 6+ messages in thread
From: Alex Deucher @ 2020-02-05 19:24 UTC (permalink / raw)
To: Takashi Iwai
Cc: David Zhou, Leo Li, Harry Wentland, amd-gfx list, Alex Deucher,
Harry Wentland, Christian K6nig
On Wed, Feb 5, 2020 at 11:55 AM Takashi Iwai <tiwai@suse.de> wrote:
>
> On Thu, 28 Nov 2019 15:35:23 +0100,
> Harry Wentland wrote:
> >
> > On 2019-11-28 3:27 a.m., Takashi Iwai wrote:
> > > 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 <tiwai@suse.de>
> >
> > Reviewed-by: Harry Wentland <harry.wentland@amd.com>
> >
> > Harry
>
> This patch seems forgotten? The compile warning is still present in
> the latest for-next.
>
Sorry, totally missed this one. Applied.
Alex
>
> thanks,
>
> Takashi
>
> >
> > > ---
> > > drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c | 4 ++--
> > > 1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c
> > > index a02c10e23e0d..b5c44c3bdb98 100644
> > > --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c
> > > +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c
> > > @@ -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
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-02-05 19:25 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-28 8:27 [PATCH] drm/amd/display: Fix wrongly passed static prefix Takashi Iwai
2019-11-28 8:27 ` Takashi Iwai
[not found] ` <20191128082714.18609-1-tiwai-l3A5Bk7waGM@public.gmane.org>
2019-11-28 14:35 ` Harry Wentland
2019-11-28 14:35 ` Harry Wentland
2020-02-05 16:55 ` Takashi Iwai
2020-02-05 19:24 ` Alex Deucher
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.