Commit ce1ace35 authored by Rex Zhu's avatar Rex Zhu Committed by Alex Deucher

drm/amd/pp: Remove unneeded void * casts in cz_hwmgr.c/cz_smumgr.c

Removes unneeded void * casts for the following pointers:
hwmgr->backend
hwmgr->smu_backend
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Reviewed-by: default avatarEvan Quan <evan.quan@amd.com>
Signed-off-by: default avatarRex Zhu <Rex.Zhu@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 2bfc270c
...@@ -181,7 +181,7 @@ static int cz_load_mec_firmware(struct pp_hwmgr *hwmgr) ...@@ -181,7 +181,7 @@ static int cz_load_mec_firmware(struct pp_hwmgr *hwmgr)
if (hwmgr == NULL || hwmgr->device == NULL) if (hwmgr == NULL || hwmgr->device == NULL)
return -EINVAL; return -EINVAL;
cz_smu = (struct cz_smumgr *)hwmgr->smu_backend; cz_smu = hwmgr->smu_backend;
ret = cgs_get_firmware_info(hwmgr->device, ret = cgs_get_firmware_info(hwmgr->device,
CGS_UCODE_ID_CP_MEC, &info); CGS_UCODE_ID_CP_MEC, &info);
...@@ -330,7 +330,7 @@ static int cz_smu_populate_single_scratch_task( ...@@ -330,7 +330,7 @@ static int cz_smu_populate_single_scratch_task(
uint8_t type, bool is_last) uint8_t type, bool is_last)
{ {
uint8_t i; uint8_t i;
struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend; struct cz_smumgr *cz_smu = hwmgr->smu_backend;
struct TOC *toc = (struct TOC *)cz_smu->toc_buffer.kaddr; struct TOC *toc = (struct TOC *)cz_smu->toc_buffer.kaddr;
struct SMU_Task *task = &toc->tasks[cz_smu->toc_entry_used_count++]; struct SMU_Task *task = &toc->tasks[cz_smu->toc_entry_used_count++];
...@@ -367,7 +367,7 @@ static int cz_smu_populate_single_ucode_load_task( ...@@ -367,7 +367,7 @@ static int cz_smu_populate_single_ucode_load_task(
bool is_last) bool is_last)
{ {
uint8_t i; uint8_t i;
struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend; struct cz_smumgr *cz_smu = hwmgr->smu_backend;
struct TOC *toc = (struct TOC *)cz_smu->toc_buffer.kaddr; struct TOC *toc = (struct TOC *)cz_smu->toc_buffer.kaddr;
struct SMU_Task *task = &toc->tasks[cz_smu->toc_entry_used_count++]; struct SMU_Task *task = &toc->tasks[cz_smu->toc_entry_used_count++];
...@@ -393,7 +393,7 @@ static int cz_smu_populate_single_ucode_load_task( ...@@ -393,7 +393,7 @@ static int cz_smu_populate_single_ucode_load_task(
static int cz_smu_construct_toc_for_rlc_aram_save(struct pp_hwmgr *hwmgr) static int cz_smu_construct_toc_for_rlc_aram_save(struct pp_hwmgr *hwmgr)
{ {
struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend; struct cz_smumgr *cz_smu = hwmgr->smu_backend;
cz_smu->toc_entry_aram = cz_smu->toc_entry_used_count; cz_smu->toc_entry_aram = cz_smu->toc_entry_used_count;
cz_smu_populate_single_scratch_task(hwmgr, cz_smu_populate_single_scratch_task(hwmgr,
...@@ -406,7 +406,7 @@ static int cz_smu_construct_toc_for_rlc_aram_save(struct pp_hwmgr *hwmgr) ...@@ -406,7 +406,7 @@ static int cz_smu_construct_toc_for_rlc_aram_save(struct pp_hwmgr *hwmgr)
static int cz_smu_initialize_toc_empty_job_list(struct pp_hwmgr *hwmgr) static int cz_smu_initialize_toc_empty_job_list(struct pp_hwmgr *hwmgr)
{ {
int i; int i;
struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend; struct cz_smumgr *cz_smu = hwmgr->smu_backend;
struct TOC *toc = (struct TOC *)cz_smu->toc_buffer.kaddr; struct TOC *toc = (struct TOC *)cz_smu->toc_buffer.kaddr;
for (i = 0; i < NUM_JOBLIST_ENTRIES; i++) for (i = 0; i < NUM_JOBLIST_ENTRIES; i++)
...@@ -417,7 +417,7 @@ static int cz_smu_initialize_toc_empty_job_list(struct pp_hwmgr *hwmgr) ...@@ -417,7 +417,7 @@ static int cz_smu_initialize_toc_empty_job_list(struct pp_hwmgr *hwmgr)
static int cz_smu_construct_toc_for_vddgfx_enter(struct pp_hwmgr *hwmgr) static int cz_smu_construct_toc_for_vddgfx_enter(struct pp_hwmgr *hwmgr)
{ {
struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend; struct cz_smumgr *cz_smu = hwmgr->smu_backend;
struct TOC *toc = (struct TOC *)cz_smu->toc_buffer.kaddr; struct TOC *toc = (struct TOC *)cz_smu->toc_buffer.kaddr;
toc->JobList[JOB_GFX_SAVE] = (uint8_t)cz_smu->toc_entry_used_count; toc->JobList[JOB_GFX_SAVE] = (uint8_t)cz_smu->toc_entry_used_count;
...@@ -435,7 +435,7 @@ static int cz_smu_construct_toc_for_vddgfx_enter(struct pp_hwmgr *hwmgr) ...@@ -435,7 +435,7 @@ static int cz_smu_construct_toc_for_vddgfx_enter(struct pp_hwmgr *hwmgr)
static int cz_smu_construct_toc_for_vddgfx_exit(struct pp_hwmgr *hwmgr) static int cz_smu_construct_toc_for_vddgfx_exit(struct pp_hwmgr *hwmgr)
{ {
struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend; struct cz_smumgr *cz_smu = hwmgr->smu_backend;
struct TOC *toc = (struct TOC *)cz_smu->toc_buffer.kaddr; struct TOC *toc = (struct TOC *)cz_smu->toc_buffer.kaddr;
toc->JobList[JOB_GFX_RESTORE] = (uint8_t)cz_smu->toc_entry_used_count; toc->JobList[JOB_GFX_RESTORE] = (uint8_t)cz_smu->toc_entry_used_count;
...@@ -477,7 +477,7 @@ static int cz_smu_construct_toc_for_vddgfx_exit(struct pp_hwmgr *hwmgr) ...@@ -477,7 +477,7 @@ static int cz_smu_construct_toc_for_vddgfx_exit(struct pp_hwmgr *hwmgr)
static int cz_smu_construct_toc_for_power_profiling(struct pp_hwmgr *hwmgr) static int cz_smu_construct_toc_for_power_profiling(struct pp_hwmgr *hwmgr)
{ {
struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend; struct cz_smumgr *cz_smu = hwmgr->smu_backend;
cz_smu->toc_entry_power_profiling_index = cz_smu->toc_entry_used_count; cz_smu->toc_entry_power_profiling_index = cz_smu->toc_entry_used_count;
...@@ -489,7 +489,7 @@ static int cz_smu_construct_toc_for_power_profiling(struct pp_hwmgr *hwmgr) ...@@ -489,7 +489,7 @@ static int cz_smu_construct_toc_for_power_profiling(struct pp_hwmgr *hwmgr)
static int cz_smu_construct_toc_for_bootup(struct pp_hwmgr *hwmgr) static int cz_smu_construct_toc_for_bootup(struct pp_hwmgr *hwmgr)
{ {
struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend; struct cz_smumgr *cz_smu = hwmgr->smu_backend;
cz_smu->toc_entry_initialize_index = cz_smu->toc_entry_used_count; cz_smu->toc_entry_initialize_index = cz_smu->toc_entry_used_count;
...@@ -517,7 +517,7 @@ static int cz_smu_construct_toc_for_bootup(struct pp_hwmgr *hwmgr) ...@@ -517,7 +517,7 @@ static int cz_smu_construct_toc_for_bootup(struct pp_hwmgr *hwmgr)
static int cz_smu_construct_toc_for_clock_table(struct pp_hwmgr *hwmgr) static int cz_smu_construct_toc_for_clock_table(struct pp_hwmgr *hwmgr)
{ {
struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend; struct cz_smumgr *cz_smu = hwmgr->smu_backend;
cz_smu->toc_entry_clock_table = cz_smu->toc_entry_used_count; cz_smu->toc_entry_clock_table = cz_smu->toc_entry_used_count;
...@@ -530,7 +530,7 @@ static int cz_smu_construct_toc_for_clock_table(struct pp_hwmgr *hwmgr) ...@@ -530,7 +530,7 @@ static int cz_smu_construct_toc_for_clock_table(struct pp_hwmgr *hwmgr)
static int cz_smu_construct_toc(struct pp_hwmgr *hwmgr) static int cz_smu_construct_toc(struct pp_hwmgr *hwmgr)
{ {
struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend; struct cz_smumgr *cz_smu = hwmgr->smu_backend;
cz_smu->toc_entry_used_count = 0; cz_smu->toc_entry_used_count = 0;
cz_smu_initialize_toc_empty_job_list(hwmgr); cz_smu_initialize_toc_empty_job_list(hwmgr);
...@@ -546,7 +546,7 @@ static int cz_smu_construct_toc(struct pp_hwmgr *hwmgr) ...@@ -546,7 +546,7 @@ static int cz_smu_construct_toc(struct pp_hwmgr *hwmgr)
static int cz_smu_populate_firmware_entries(struct pp_hwmgr *hwmgr) static int cz_smu_populate_firmware_entries(struct pp_hwmgr *hwmgr)
{ {
struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend; struct cz_smumgr *cz_smu = hwmgr->smu_backend;
uint32_t firmware_type; uint32_t firmware_type;
uint32_t i; uint32_t i;
int ret; int ret;
...@@ -584,7 +584,7 @@ static int cz_smu_populate_single_scratch_entry( ...@@ -584,7 +584,7 @@ static int cz_smu_populate_single_scratch_entry(
uint32_t ulsize_byte, uint32_t ulsize_byte,
struct cz_buffer_entry *entry) struct cz_buffer_entry *entry)
{ {
struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend; struct cz_smumgr *cz_smu = hwmgr->smu_backend;
uint32_t ulsize_aligned = SIZE_ALIGN_32(ulsize_byte); uint32_t ulsize_aligned = SIZE_ALIGN_32(ulsize_byte);
entry->data_size = ulsize_byte; entry->data_size = ulsize_byte;
...@@ -600,7 +600,7 @@ static int cz_smu_populate_single_scratch_entry( ...@@ -600,7 +600,7 @@ static int cz_smu_populate_single_scratch_entry(
static int cz_download_pptable_settings(struct pp_hwmgr *hwmgr, void **table) static int cz_download_pptable_settings(struct pp_hwmgr *hwmgr, void **table)
{ {
struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend; struct cz_smumgr *cz_smu = hwmgr->smu_backend;
unsigned long i; unsigned long i;
for (i = 0; i < cz_smu->scratch_buffer_length; i++) { for (i = 0; i < cz_smu->scratch_buffer_length; i++) {
...@@ -629,7 +629,7 @@ static int cz_download_pptable_settings(struct pp_hwmgr *hwmgr, void **table) ...@@ -629,7 +629,7 @@ static int cz_download_pptable_settings(struct pp_hwmgr *hwmgr, void **table)
static int cz_upload_pptable_settings(struct pp_hwmgr *hwmgr) static int cz_upload_pptable_settings(struct pp_hwmgr *hwmgr)
{ {
struct cz_smumgr *cz_smu = (struct cz_smumgr *)hwmgr->smu_backend; struct cz_smumgr *cz_smu = hwmgr->smu_backend;
unsigned long i; unsigned long i;
for (i = 0; i < cz_smu->scratch_buffer_length; i++) { for (i = 0; i < cz_smu->scratch_buffer_length; i++) {
...@@ -656,7 +656,7 @@ static int cz_upload_pptable_settings(struct pp_hwmgr *hwmgr) ...@@ -656,7 +656,7 @@ static int cz_upload_pptable_settings(struct pp_hwmgr *hwmgr)
static int cz_request_smu_load_fw(struct pp_hwmgr *hwmgr) static int cz_request_smu_load_fw(struct pp_hwmgr *hwmgr)
{ {
struct cz_smumgr *cz_smu = (struct cz_smumgr *)(hwmgr->smu_backend); struct cz_smumgr *cz_smu = hwmgr->smu_backend;
uint32_t smc_address; uint32_t smc_address;
if (!hwmgr->reload_fw) { if (!hwmgr->reload_fw) {
...@@ -837,7 +837,7 @@ static int cz_smu_fini(struct pp_hwmgr *hwmgr) ...@@ -837,7 +837,7 @@ static int cz_smu_fini(struct pp_hwmgr *hwmgr)
if (hwmgr == NULL || hwmgr->device == NULL) if (hwmgr == NULL || hwmgr->device == NULL)
return -EINVAL; return -EINVAL;
cz_smu = (struct cz_smumgr *)hwmgr->smu_backend; cz_smu = hwmgr->smu_backend;
if (cz_smu) { if (cz_smu) {
amdgpu_bo_free_kernel(&cz_smu->toc_buffer.handle, amdgpu_bo_free_kernel(&cz_smu->toc_buffer.handle,
&cz_smu->toc_buffer.mc_addr, &cz_smu->toc_buffer.mc_addr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment