Skip to contentSkip to conversation

drm/amd/pp: Fix build warning

PATCH In review Rex Zhu 2 participants 2 messages May 17, 2018 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Rex Zhu

author
#0 lore raw

PATCH 1/1 drm/amd/pp: Fix build warning

warning: missing braces around initializer [-Wmissing-braces]

---
 drivers/gpu/drm/amd/powerplay/hwmgr/ppatomctrl.c    | 2 +-
 drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/ppatomctrl.c +1 -1
index cf99c5e..ec38c9f 100644
@@ -320,7 +320,7 @@ int atomctrl_get_memory_pll_dividers_ai(struct pp_hwmgr *hwmgr,
 					pp_atomctrl_memory_clock_param_ai *mpll_param)
 {
 	struct amdgpu_device *adev = hwmgr->adev;
-	COMPUTE_MEMORY_CLOCK_PARAM_PARAMETERS_V2_3 mpll_parameters = {0};
+	COMPUTE_MEMORY_CLOCK_PARAM_PARAMETERS_V2_3 mpll_parameters = {{0}, 0, 0};
 	int result;
 
 	mpll_parameters.ulClock.ulClock = cpu_to_le32(clock_value);
drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c +3 -1
index c9a5633..a40f714 100644
@@ -1366,10 +1366,12 @@ static int vegam_program_memory_timing_parameters(struct pp_hwmgr *hwmgr)
 {
 	struct smu7_hwmgr *hw_data = (struct smu7_hwmgr *)(hwmgr->backend);
 	struct vegam_smumgr *smu_data = (struct vegam_smumgr *)(hwmgr->smu_backend);
-	struct SMU75_Discrete_MCArbDramTimingTable arb_regs = {0};
+	struct SMU75_Discrete_MCArbDramTimingTable arb_regs;
 	uint32_t i, j;
 	int result = 0;
 
+	memset(&arb_regs, 0, sizeof(SMU75_Discrete_MCArbDramTimingTable));
+
 	for (i = 0; i < hw_data->dpm_table.sclk_table.count; i++) {
 		for (j = 0; j < hw_data->dpm_table.mclk_table.count; j++) {
 			result = vegam_populate_memory_timing_parameters(hwmgr,
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1526559834-9805-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org

Acked-by
#2 lore raw
Quoted 3 lines · Rex Zhu

warning: missing braces around initializer [-Wmissing-braces]

Quoted 39 lines
---
 drivers/gpu/drm/amd/powerplay/hwmgr/ppatomctrl.c    | 2 +-
 drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/ppatomctrl.c +1 -1
index cf99c5e..ec38c9f 100644
@@ -320,7 +320,7 @@ int atomctrl_get_memory_pll_dividers_ai(struct pp_hwmgr *hwmgr,
                                        pp_atomctrl_memory_clock_param_ai *mpll_param)
 {
        struct amdgpu_device *adev = hwmgr->adev;
-       COMPUTE_MEMORY_CLOCK_PARAM_PARAMETERS_V2_3 mpll_parameters = {0};
+       COMPUTE_MEMORY_CLOCK_PARAM_PARAMETERS_V2_3 mpll_parameters = {{0}, 0, 0};
        int result;
 
        mpll_parameters.ulClock.ulClock = cpu_to_le32(clock_value);
drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c +3 -2
index c9a5633..a40f714 100644
@@ -1366,10 +1366,12 @@ static int vegam_program_memory_timing_parameters(struct pp_hwmgr *hwmgr)
 {
        struct smu7_hwmgr *hw_data = (struct smu7_hwmgr *)(hwmgr->backend);
        struct vegam_smumgr *smu_data = (struct vegam_smumgr *)(hwmgr->smu_backend);
-       struct SMU75_Discrete_MCArbDramTimingTable arb_regs = {0};
+       struct SMU75_Discrete_MCArbDramTimingTable arb_regs;
        uint32_t i, j;
        int result = 0;
 
+       memset(&arb_regs, 0, sizeof(SMU75_Discrete_MCArbDramTimingTable));
+
        for (i = 0; i < hw_data->dpm_table.sclk_table.count; i++) {
                for (j = 0; j < hw_data->dpm_table.mclk_table.count; j++) {
                        result = vegam_populate_memory_timing_parameters(hwmgr,
--

1.9.1

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx