All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: fix type of variable
@ 2018-06-15 13:32 Gustavo A. R. Silva
  2018-06-15 16:39   ` Alex Deucher
  0 siblings, 1 reply; 3+ messages in thread
From: Gustavo A. R. Silva @ 2018-06-15 13:32 UTC (permalink / raw)
  To: Signed-off-by-CC+yJ3UmIYqDUpFQwHEjaQ, Roman Li, Alex Deucher,
	Christian König, David (ChunMing) Zhou, David Airlie
  Cc: Gustavo A. R. Silva, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

Currently, the maximum value that *counter* can reach is 255, and
code at line 150: while (counter < 1000) { implies a bigger value
could be expected.

Fix this by changing the type of variable *counter* from uint8_t
to uint16_t.

Addresses-Coverity-ID: 1470030 ("Operands don't affect result")
Fixes: 2b6199a1d1b7 ("drm/amd/display: replace msleep with udelay in fbc path")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c
index e2994d3..111c492 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c
@@ -143,7 +143,7 @@ static void wait_for_fbc_state_changed(
 	struct dce110_compressor *cp110,
 	bool enabled)
 {
-	uint8_t counter = 0;
+	uint16_t counter = 0;
 	uint32_t addr = mmFBC_STATUS;
 	uint32_t value;
 
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amd/display: fix type of variable
  2018-06-15 13:32 [PATCH] drm/amd/display: fix type of variable Gustavo A. R. Silva
@ 2018-06-15 16:39   ` Alex Deucher
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2018-06-15 16:39 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Signed-off-by@freedesktop.org:Roman Li <Roman.Li@amd.com>,
	Alex Deucher <alexander.deucher@amd.com>,
	Christian König <christian.koenig@amd.com>,
	David (ChunMing) Zhou <David1.Zhou@amd.com>,
	David Airlie, Maling list - DRI developers, amd-gfx list, LKML

On Fri, Jun 15, 2018 at 9:32 AM, Gustavo A. R. Silva
<gustavo@embeddedor.com> wrote:
> Currently, the maximum value that *counter* can reach is 255, and
> code at line 150: while (counter < 1000) { implies a bigger value
> could be expected.
>
> Fix this by changing the type of variable *counter* from uint8_t
> to uint16_t.
>
> Addresses-Coverity-ID: 1470030 ("Operands don't affect result")
> Fixes: 2b6199a1d1b7 ("drm/amd/display: replace msleep with udelay in fbc path")
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

Applied.  thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c
> index e2994d3..111c492 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c
> @@ -143,7 +143,7 @@ static void wait_for_fbc_state_changed(
>         struct dce110_compressor *cp110,
>         bool enabled)
>  {
> -       uint8_t counter = 0;
> +       uint16_t counter = 0;
>         uint32_t addr = mmFBC_STATUS;
>         uint32_t value;
>
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amd/display: fix type of variable
@ 2018-06-15 16:39   ` Alex Deucher
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2018-06-15 16:39 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Signed-off-by@freedesktop.org:Roman Li <Roman.Li@amd.com>,
	Alex Deucher <alexander.deucher@amd.com>,
	Christian König <christian.koenig@amd.com>,
	David (ChunMing) Zhou <David1.Zhou@amd.com>,
	David Airlie, amd-gfx list, Maling list - DRI developers, LKML

On Fri, Jun 15, 2018 at 9:32 AM, Gustavo A. R. Silva
<gustavo@embeddedor.com> wrote:
> Currently, the maximum value that *counter* can reach is 255, and
> code at line 150: while (counter < 1000) { implies a bigger value
> could be expected.
>
> Fix this by changing the type of variable *counter* from uint8_t
> to uint16_t.
>
> Addresses-Coverity-ID: 1470030 ("Operands don't affect result")
> Fixes: 2b6199a1d1b7 ("drm/amd/display: replace msleep with udelay in fbc path")
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

Applied.  thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c
> index e2994d3..111c492 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c
> @@ -143,7 +143,7 @@ static void wait_for_fbc_state_changed(
>         struct dce110_compressor *cp110,
>         bool enabled)
>  {
> -       uint8_t counter = 0;
> +       uint16_t counter = 0;
>         uint32_t addr = mmFBC_STATUS;
>         uint32_t value;
>
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-06-15 16:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-15 13:32 [PATCH] drm/amd/display: fix type of variable Gustavo A. R. Silva
2018-06-15 16:39 ` Alex Deucher
2018-06-15 16:39   ` 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.