drm/amdgpu: remove memset after kzalloc
authorFuqian Huang <huangfq.daxian@gmail.com>
Mon, 15 Jul 2019 03:17:31 +0000 (11:17 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 16 Jul 2019 18:09:05 +0000 (13:09 -0500)
kzalloc has already zeroed the memory during the allocation.
So memset is unneeded.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c
drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c
drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c
drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c

index 1cd5a8b5cdc179a30d231cdd1079fec8b410373f..b760f95e7fa7adb850e99117c45b94452d277068 100644 (file)
@@ -1067,8 +1067,6 @@ static int pp_tables_v1_0_initialize(struct pp_hwmgr *hwmgr)
        PP_ASSERT_WITH_CODE((NULL != hwmgr->pptable),
                            "Failed to allocate hwmgr->pptable!", return -ENOMEM);
 
-       memset(hwmgr->pptable, 0x00, sizeof(struct phm_ppt_v1_information));
-
        powerplay_table = get_powerplay_table(hwmgr);
 
        PP_ASSERT_WITH_CODE((NULL != powerplay_table),
index 6c81cb91ebae87209c7616fd21f0347907a82855..15590fd86ef4ac5d3fb4a36c8a2467c61ad9390e 100644 (file)
@@ -2705,8 +2705,6 @@ static int ci_initialize_mc_reg_table(struct pp_hwmgr *hwmgr)
        cgs_write_register(hwmgr->device, mmMC_SEQ_PMG_CMD_MRS2_LP, cgs_read_register(hwmgr->device, mmMC_PMG_CMD_MRS2));
        cgs_write_register(hwmgr->device, mmMC_SEQ_WR_CTL_2_LP, cgs_read_register(hwmgr->device, mmMC_SEQ_WR_CTL_2));
 
-       memset(table, 0x00, sizeof(pp_atomctrl_mc_reg_table));
-
        result = atomctrl_initialize_mc_reg_table(hwmgr, module_index, table);
 
        if (0 == result)
index 9e0dd56fe7c50d3d3a74d8b72d5bd0b03a6050de..732005c03a82d89f7528ee067ea93c3f259d7195 100644 (file)
@@ -2634,8 +2634,6 @@ static int iceland_initialize_mc_reg_table(struct pp_hwmgr *hwmgr)
        cgs_write_register(hwmgr->device, mmMC_SEQ_PMG_CMD_MRS2_LP, cgs_read_register(hwmgr->device, mmMC_PMG_CMD_MRS2));
        cgs_write_register(hwmgr->device, mmMC_SEQ_WR_CTL_2_LP, cgs_read_register(hwmgr->device, mmMC_SEQ_WR_CTL_2));
 
-       memset(table, 0x00, sizeof(pp_atomctrl_mc_reg_table));
-
        result = atomctrl_initialize_mc_reg_table(hwmgr, module_index, table);
 
        if (0 == result)
index ba3394303b9c2812bc58e0baa5cd763a65248c6d..f19bac7ef7ba6cfa15dc906a65c1124c605d91f2 100644 (file)
@@ -3117,8 +3117,6 @@ static int tonga_initialize_mc_reg_table(struct pp_hwmgr *hwmgr)
        cgs_write_register(hwmgr->device, mmMC_SEQ_WR_CTL_2_LP,
                        cgs_read_register(hwmgr->device, mmMC_SEQ_WR_CTL_2));
 
-       memset(table, 0x00, sizeof(pp_atomctrl_mc_reg_table));
-
        result = atomctrl_initialize_mc_reg_table(hwmgr, module_index, table);
 
        if (!result)