drm/amd/display: fix struct init in update_bounding_box
authorRaul E Rangel <rrangel@chromium.org>
Thu, 3 Oct 2019 20:24:44 +0000 (14:24 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 4 Oct 2019 13:53:14 +0000 (08:53 -0500)
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>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c

index 880257e3d1e76309df62929b37e63c77faa199e8..f2a0ca0e6010a70e6e7ccec3e39b1bee6ece361c 100644 (file)
@@ -3015,7 +3015,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];
        int i;
        int num_calculated_states = 0;
        int min_dcfclk = 0;
@@ -3023,6 +3023,8 @@ static void update_bounding_box(struct dc *dc, struct _vcs_dpi_soc_bounding_box_
        if (num_states == 0)
                return;
 
+       memset(calculated_states, 0, sizeof(calculated_states));
+
        if (dc->bb_overrides.min_dcfclk_mhz > 0)
                min_dcfclk = dc->bb_overrides.min_dcfclk_mhz;
        else