All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: use ARRAY_SIZE for base60_refresh_rates
@ 2021-06-09 10:09 ` Jiapeng Chong
  0 siblings, 0 replies; 6+ messages in thread
From: Jiapeng Chong @ 2021-06-09 10:09 UTC (permalink / raw)
  To: harry.wentland
  Cc: sunpeng.li, alexander.deucher, christian.koenig, Xinhui.Pan,
	airlied, daniel, amd-gfx, dri-devel, linux-kernel, Jiapeng Chong

Use ARRAY_SIZE instead of dividing sizeof array with sizeof an
element.

Clean up the following coccicheck warning:

./drivers/gpu/drm/amd/display/dc/core/dc_resource.c:448:47-48: WARNING:
Use ARRAY_SIZE.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
index 57afe71..3f00989 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -445,7 +445,7 @@ bool resource_are_vblanks_synchronizable(
 {
 	uint32_t base60_refresh_rates[] = {10, 20, 5};
 	uint8_t i;
-	uint8_t rr_count = sizeof(base60_refresh_rates)/sizeof(base60_refresh_rates[0]);
+	uint8_t rr_count = ARRAY_SIZE(base60_refresh_rates);
 	uint64_t frame_time_diff;
 
 	if (stream1->ctx->dc->config.vblank_alignment_dto_params &&
-- 
1.8.3.1


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

* [PATCH] drm/amd/display: use ARRAY_SIZE for base60_refresh_rates
@ 2021-06-09 10:09 ` Jiapeng Chong
  0 siblings, 0 replies; 6+ messages in thread
From: Jiapeng Chong @ 2021-06-09 10:09 UTC (permalink / raw)
  To: harry.wentland
  Cc: Jiapeng Chong, sunpeng.li, Xinhui.Pan, linux-kernel, amd-gfx,
	airlied, dri-devel, alexander.deucher, christian.koenig

Use ARRAY_SIZE instead of dividing sizeof array with sizeof an
element.

Clean up the following coccicheck warning:

./drivers/gpu/drm/amd/display/dc/core/dc_resource.c:448:47-48: WARNING:
Use ARRAY_SIZE.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
index 57afe71..3f00989 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -445,7 +445,7 @@ bool resource_are_vblanks_synchronizable(
 {
 	uint32_t base60_refresh_rates[] = {10, 20, 5};
 	uint8_t i;
-	uint8_t rr_count = sizeof(base60_refresh_rates)/sizeof(base60_refresh_rates[0]);
+	uint8_t rr_count = ARRAY_SIZE(base60_refresh_rates);
 	uint64_t frame_time_diff;
 
 	if (stream1->ctx->dc->config.vblank_alignment_dto_params &&
-- 
1.8.3.1


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

* [PATCH] drm/amd/display: use ARRAY_SIZE for base60_refresh_rates
@ 2021-06-09 10:09 ` Jiapeng Chong
  0 siblings, 0 replies; 6+ messages in thread
From: Jiapeng Chong @ 2021-06-09 10:09 UTC (permalink / raw)
  To: harry.wentland
  Cc: Jiapeng Chong, sunpeng.li, Xinhui.Pan, linux-kernel, amd-gfx,
	airlied, dri-devel, daniel, alexander.deucher, christian.koenig

Use ARRAY_SIZE instead of dividing sizeof array with sizeof an
element.

Clean up the following coccicheck warning:

./drivers/gpu/drm/amd/display/dc/core/dc_resource.c:448:47-48: WARNING:
Use ARRAY_SIZE.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
index 57afe71..3f00989 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -445,7 +445,7 @@ bool resource_are_vblanks_synchronizable(
 {
 	uint32_t base60_refresh_rates[] = {10, 20, 5};
 	uint8_t i;
-	uint8_t rr_count = sizeof(base60_refresh_rates)/sizeof(base60_refresh_rates[0]);
+	uint8_t rr_count = ARRAY_SIZE(base60_refresh_rates);
 	uint64_t frame_time_diff;
 
 	if (stream1->ctx->dc->config.vblank_alignment_dto_params &&
-- 
1.8.3.1

_______________________________________________
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: use ARRAY_SIZE for base60_refresh_rates
  2021-06-09 10:09 ` Jiapeng Chong
  (?)
@ 2021-06-09 21:12   ` Alex Deucher
  -1 siblings, 0 replies; 6+ messages in thread
From: Alex Deucher @ 2021-06-09 21:12 UTC (permalink / raw)
  To: Jiapeng Chong
  Cc: Wentland, Harry, Leo (Sunpeng) Li, xinhui pan, LKML,
	amd-gfx list, Dave Airlie, Maling list - DRI developers, Deucher,
	Alexander, Christian Koenig

Applied.  Thanks!

On Wed, Jun 9, 2021 at 6:09 AM Jiapeng Chong
<jiapeng.chong@linux.alibaba.com> wrote:
>
> Use ARRAY_SIZE instead of dividing sizeof array with sizeof an
> element.
>
> Clean up the following coccicheck warning:
>
> ./drivers/gpu/drm/amd/display/dc/core/dc_resource.c:448:47-48: WARNING:
> Use ARRAY_SIZE.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
> index 57afe71..3f00989 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
> @@ -445,7 +445,7 @@ bool resource_are_vblanks_synchronizable(
>  {
>         uint32_t base60_refresh_rates[] = {10, 20, 5};
>         uint8_t i;
> -       uint8_t rr_count = sizeof(base60_refresh_rates)/sizeof(base60_refresh_rates[0]);
> +       uint8_t rr_count = ARRAY_SIZE(base60_refresh_rates);
>         uint64_t frame_time_diff;
>
>         if (stream1->ctx->dc->config.vblank_alignment_dto_params &&
> --
> 1.8.3.1
>

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

* Re: [PATCH] drm/amd/display: use ARRAY_SIZE for base60_refresh_rates
@ 2021-06-09 21:12   ` Alex Deucher
  0 siblings, 0 replies; 6+ messages in thread
From: Alex Deucher @ 2021-06-09 21:12 UTC (permalink / raw)
  To: Jiapeng Chong
  Cc: Leo (Sunpeng) Li, xinhui pan, LKML, amd-gfx list, Dave Airlie,
	Maling list - DRI developers, Deucher, Alexander,
	Christian Koenig

Applied.  Thanks!

On Wed, Jun 9, 2021 at 6:09 AM Jiapeng Chong
<jiapeng.chong@linux.alibaba.com> wrote:
>
> Use ARRAY_SIZE instead of dividing sizeof array with sizeof an
> element.
>
> Clean up the following coccicheck warning:
>
> ./drivers/gpu/drm/amd/display/dc/core/dc_resource.c:448:47-48: WARNING:
> Use ARRAY_SIZE.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
> index 57afe71..3f00989 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
> @@ -445,7 +445,7 @@ bool resource_are_vblanks_synchronizable(
>  {
>         uint32_t base60_refresh_rates[] = {10, 20, 5};
>         uint8_t i;
> -       uint8_t rr_count = sizeof(base60_refresh_rates)/sizeof(base60_refresh_rates[0]);
> +       uint8_t rr_count = ARRAY_SIZE(base60_refresh_rates);
>         uint64_t frame_time_diff;
>
>         if (stream1->ctx->dc->config.vblank_alignment_dto_params &&
> --
> 1.8.3.1
>

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

* Re: [PATCH] drm/amd/display: use ARRAY_SIZE for base60_refresh_rates
@ 2021-06-09 21:12   ` Alex Deucher
  0 siblings, 0 replies; 6+ messages in thread
From: Alex Deucher @ 2021-06-09 21:12 UTC (permalink / raw)
  To: Jiapeng Chong
  Cc: Leo (Sunpeng) Li, xinhui pan, LKML, amd-gfx list, Dave Airlie,
	Maling list - DRI developers, Deucher, Alexander, Wentland,
	Harry, Christian Koenig

Applied.  Thanks!

On Wed, Jun 9, 2021 at 6:09 AM Jiapeng Chong
<jiapeng.chong@linux.alibaba.com> wrote:
>
> Use ARRAY_SIZE instead of dividing sizeof array with sizeof an
> element.
>
> Clean up the following coccicheck warning:
>
> ./drivers/gpu/drm/amd/display/dc/core/dc_resource.c:448:47-48: WARNING:
> Use ARRAY_SIZE.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
> index 57afe71..3f00989 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
> @@ -445,7 +445,7 @@ bool resource_are_vblanks_synchronizable(
>  {
>         uint32_t base60_refresh_rates[] = {10, 20, 5};
>         uint8_t i;
> -       uint8_t rr_count = sizeof(base60_refresh_rates)/sizeof(base60_refresh_rates[0]);
> +       uint8_t rr_count = ARRAY_SIZE(base60_refresh_rates);
>         uint64_t frame_time_diff;
>
>         if (stream1->ctx->dc->config.vblank_alignment_dto_params &&
> --
> 1.8.3.1
>
_______________________________________________
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:[~2021-06-09 21:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-09 10:09 [PATCH] drm/amd/display: use ARRAY_SIZE for base60_refresh_rates Jiapeng Chong
2021-06-09 10:09 ` Jiapeng Chong
2021-06-09 10:09 ` Jiapeng Chong
2021-06-09 21:12 ` Alex Deucher
2021-06-09 21:12   ` Alex Deucher
2021-06-09 21:12   ` 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.