summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_processpptables.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_processpptables.c')
-rw-r--r--drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_processpptables.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_processpptables.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_processpptables.c
index 3be616af327e..2b9a1840a35a 100644
--- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_processpptables.c
+++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_processpptables.c
@@ -350,8 +350,8 @@ static int get_mm_clock_voltage_table(
PP_ASSERT_WITH_CODE((mm_dependency_table->ucNumEntries != 0),
"Invalid PowerPlay Table!", return -1);
- mm_table = kzalloc(struct_size(mm_table, entries, mm_dependency_table->ucNumEntries),
- GFP_KERNEL);
+ mm_table = kzalloc_flex(*mm_table, entries,
+ mm_dependency_table->ucNumEntries, GFP_KERNEL);
if (!mm_table)
return -ENOMEM;
@@ -573,8 +573,8 @@ static int get_socclk_voltage_dependency_table(
PP_ASSERT_WITH_CODE(clk_dep_table->ucNumEntries,
"Invalid PowerPlay Table!", return -1);
- clk_table = kzalloc(struct_size(clk_table, entries, clk_dep_table->ucNumEntries),
- GFP_KERNEL);
+ clk_table = kzalloc_flex(*clk_table, entries,
+ clk_dep_table->ucNumEntries, GFP_KERNEL);
if (!clk_table)
return -ENOMEM;
@@ -603,8 +603,8 @@ static int get_mclk_voltage_dependency_table(
PP_ASSERT_WITH_CODE(mclk_dep_table->ucNumEntries,
"Invalid PowerPlay Table!", return -1);
- mclk_table = kzalloc(struct_size(mclk_table, entries, mclk_dep_table->ucNumEntries),
- GFP_KERNEL);
+ mclk_table = kzalloc_flex(*mclk_table, entries,
+ mclk_dep_table->ucNumEntries, GFP_KERNEL);
if (!mclk_table)
return -ENOMEM;
@@ -640,8 +640,8 @@ static int get_gfxclk_voltage_dependency_table(
PP_ASSERT_WITH_CODE((clk_dep_table->ucNumEntries != 0),
"Invalid PowerPlay Table!", return -1);
- clk_table = kzalloc(struct_size(clk_table, entries, clk_dep_table->ucNumEntries),
- GFP_KERNEL);
+ clk_table = kzalloc_flex(*clk_table, entries,
+ clk_dep_table->ucNumEntries, GFP_KERNEL);
if (!clk_table)
return -ENOMEM;
@@ -702,8 +702,8 @@ static int get_pix_clk_voltage_dependency_table(
PP_ASSERT_WITH_CODE((clk_dep_table->ucNumEntries != 0),
"Invalid PowerPlay Table!", return -1);
- clk_table = kzalloc(struct_size(clk_table, entries, clk_dep_table->ucNumEntries),
- GFP_KERNEL);
+ clk_table = kzalloc_flex(*clk_table, entries,
+ clk_dep_table->ucNumEntries, GFP_KERNEL);
if (!clk_table)
return -ENOMEM;
@@ -755,8 +755,7 @@ static int get_dcefclk_voltage_dependency_table(
num_entries = clk_dep_table->ucNumEntries;
- clk_table = kzalloc(struct_size(clk_table, entries, num_entries),
- GFP_KERNEL);
+ clk_table = kzalloc_flex(*clk_table, entries, num_entries, GFP_KERNEL);
if (!clk_table)
return -ENOMEM;
@@ -794,8 +793,8 @@ static int get_pcie_table(struct pp_hwmgr *hwmgr,
"Invalid PowerPlay Table!",
return 0);
- pcie_table = kzalloc(struct_size(pcie_table, entries, atom_pcie_table->ucNumEntries),
- GFP_KERNEL);
+ pcie_table = kzalloc_flex(*pcie_table, entries,
+ atom_pcie_table->ucNumEntries, GFP_KERNEL);
if (!pcie_table)
return -ENOMEM;
@@ -853,8 +852,8 @@ static int get_valid_clk(
PP_ASSERT_WITH_CODE(clk_volt_pp_table->count,
"Invalid PowerPlay Table!", return -1);
- table = kzalloc(struct_size(table, values, clk_volt_pp_table->count),
- GFP_KERNEL);
+ table = kzalloc_flex(*table, values, clk_volt_pp_table->count,
+ GFP_KERNEL);
if (!table)
return -ENOMEM;
@@ -1041,7 +1040,7 @@ static int get_vddc_lookup_table(
PP_ASSERT_WITH_CODE((vddc_lookup_pp_tables->ucNumEntries != 0),
"Invalid SOC_VDDD Lookup Table!", return 1);
- table = kzalloc(struct_size(table, entries, max_levels), GFP_KERNEL);
+ table = kzalloc_flex(*table, entries, max_levels, GFP_KERNEL);
if (!table)
return -ENOMEM;
@@ -1149,7 +1148,7 @@ static int vega10_pp_tables_initialize(struct pp_hwmgr *hwmgr)
int result = 0;
const ATOM_Vega10_POWERPLAYTABLE *powerplay_table;
- hwmgr->pptable = kzalloc(sizeof(struct phm_ppt_v2_information), GFP_KERNEL);
+ hwmgr->pptable = kzalloc_obj(struct phm_ppt_v2_information, GFP_KERNEL);
PP_ASSERT_WITH_CODE((hwmgr->pptable != NULL),
"Failed to allocate hwmgr->pptable!", return -ENOMEM);