linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] drm/amd/display: fix struct init in update_bounding_box
@ 2019-08-28 18:37 Raul E Rangel
  2019-09-19 21:40 ` Raul Rangel
  2019-09-19 21:52 ` Alex Deucher
  0 siblings, 2 replies; 3+ messages in thread
From: Raul E Rangel @ 2019-08-28 18:37 UTC (permalink / raw)
  To: amd-gfx
  Cc: Raul E Rangel, Leo Li, David Airlie, Dmytro Laktyushkin,
	David (ChunMing) Zhou, hersen wu, linux-kernel, dri-devel,
	Nikola Cornij, Alex Deucher, Bhawanpreet Lakha, Harry Wentland,
	Charlene Liu, Christian König, Jun Lei, Daniel Vetter

dcn20_resource.c:2636:9: error: missing braces around initializer [-Werror=missing-braces]
  struct _vcs_dpi_voltage_scaling_st calculated_states[MAX_CLOCK_LIMIT_STATES] = {0};
         ^
Fixes: 7ed4e6352c16f ("drm/amd/display: Add DCN2 HW Sequencer and Resource")

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
---
So apparently `{}` is a gcc extension. The C standard requires at least
one expression. So {{0}} is correct. I got a lint error about {{0}}
needing a space, so i use `{ {0} }`.

Changes in v2:
- Use { {0} } instead of {}

 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
index b949e202d6cb..8e6433be2252 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
@@ -2633,7 +2633,7 @@ static void cap_soc_clocks(
 static void update_bounding_box(struct dc *dc, struct _vcs_dpi_soc_bounding_box_st *bb,
 		struct pp_smu_nv_clock_table *max_clocks, unsigned int *uclk_states, unsigned int num_states)
 {
-	struct _vcs_dpi_voltage_scaling_st calculated_states[MAX_CLOCK_LIMIT_STATES] = {0};
+	struct _vcs_dpi_voltage_scaling_st calculated_states[MAX_CLOCK_LIMIT_STATES] = { {0} };
 	int i;
 	int num_calculated_states = 0;
 	int min_dcfclk = 0;
-- 
2.23.0.187.g17f5b7556c-goog


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

* Re: [PATCH v2] drm/amd/display: fix struct init in update_bounding_box
  2019-08-28 18:37 [PATCH v2] drm/amd/display: fix struct init in update_bounding_box Raul E Rangel
@ 2019-09-19 21:40 ` Raul Rangel
  2019-09-19 21:52 ` Alex Deucher
  1 sibling, 0 replies; 3+ messages in thread
From: Raul Rangel @ 2019-09-19 21:40 UTC (permalink / raw)
  To: amd-gfx
  Cc: Leo Li, David Airlie, Dmytro Laktyushkin, David (ChunMing) Zhou,
	hersen wu, linux-kernel, dri-devel, Nikola Cornij, Alex Deucher,
	Bhawanpreet Lakha, Harry Wentland, Charlene Liu,
	Christian König, Jun Lei, Daniel Vetter

Friendly ping for review.

Thanks

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

* Re: [PATCH v2] drm/amd/display: fix struct init in update_bounding_box
  2019-08-28 18:37 [PATCH v2] drm/amd/display: fix struct init in update_bounding_box Raul E Rangel
  2019-09-19 21:40 ` Raul Rangel
@ 2019-09-19 21:52 ` Alex Deucher
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2019-09-19 21:52 UTC (permalink / raw)
  To: Raul E Rangel
  Cc: amd-gfx list, David (ChunMing) Zhou, Charlene Liu, Leo Li,
	Harry Wentland, David Airlie, LKML, Maling list - DRI developers,
	Nikola Cornij, Dmytro Laktyushkin, hersen wu, Daniel Vetter,
	Alex Deucher, Jun Lei, Bhawanpreet Lakha, Christian König

On Wed, Aug 28, 2019 at 2:51 PM Raul E Rangel <rrangel@chromium.org> wrote:
>
> dcn20_resource.c:2636:9: error: missing braces around initializer [-Werror=missing-braces]
>   struct _vcs_dpi_voltage_scaling_st calculated_states[MAX_CLOCK_LIMIT_STATES] = {0};
>          ^
> Fixes: 7ed4e6352c16f ("drm/amd/display: Add DCN2 HW Sequencer and Resource")
>
> Signed-off-by: Raul E Rangel <rrangel@chromium.org>
> ---
> So apparently `{}` is a gcc extension. The C standard requires at least
> one expression. So {{0}} is correct. I got a lint error about {{0}}
> needing a space, so i use `{ {0} }`.

I think there were issues with {{}} as well.  How about just a memset?

Alex

>
> Changes in v2:
> - Use { {0} } instead of {}
>
>  drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
> index b949e202d6cb..8e6433be2252 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
> @@ -2633,7 +2633,7 @@ static void cap_soc_clocks(
>  static void update_bounding_box(struct dc *dc, struct _vcs_dpi_soc_bounding_box_st *bb,
>                 struct pp_smu_nv_clock_table *max_clocks, unsigned int *uclk_states, unsigned int num_states)
>  {
> -       struct _vcs_dpi_voltage_scaling_st calculated_states[MAX_CLOCK_LIMIT_STATES] = {0};
> +       struct _vcs_dpi_voltage_scaling_st calculated_states[MAX_CLOCK_LIMIT_STATES] = { {0} };
>         int i;
>         int num_calculated_states = 0;
>         int min_dcfclk = 0;
> --
> 2.23.0.187.g17f5b7556c-goog
>
> _______________________________________________
> 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

end of thread, other threads:[~2019-09-19 21:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-28 18:37 [PATCH v2] drm/amd/display: fix struct init in update_bounding_box Raul E Rangel
2019-09-19 21:40 ` Raul Rangel
2019-09-19 21:52 ` Alex Deucher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).