Skip to content

Commit bddf309

Browse files
qianfengrongalexdeucher
authored andcommitted
drm/amd/pm: use int type to store negative error codes
Use int instead of uint32_t for 'ret' variable to store negative error codes or zero returned by other functions. Storing the negative error codes in unsigned type, doesn't cause an issue at runtime but can be confusing. Additionally, assigning negative error codes to unsigned type may trigger a GCC warning when the -Wsign-conversion flag is enabled. No effect on runtime. Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent a055658 commit bddf309

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1032,7 +1032,7 @@ static int smu10_print_clock_levels(struct pp_hwmgr *hwmgr,
10321032
data->clock_vol_info.vdd_dep_on_fclk;
10331033
uint32_t i, now, size = 0;
10341034
uint32_t min_freq, max_freq = 0;
1035-
uint32_t ret = 0;
1035+
int ret = 0;
10361036

10371037
switch (type) {
10381038
case PP_SCLK:

drivers/gpu/drm/amd/pm/powerplay/smumgr/smu7_smumgr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ int smu7_request_smu_load_fw(struct pp_hwmgr *hwmgr)
401401
int smu7_check_fw_load_finish(struct pp_hwmgr *hwmgr, uint32_t fw_type)
402402
{
403403
struct smu7_smumgr *smu_data = (struct smu7_smumgr *)(hwmgr->smu_backend);
404-
uint32_t ret;
404+
int ret;
405405

406406
ret = phm_wait_on_indirect_register(hwmgr, mmSMC_IND_INDEX_11,
407407
smu_data->soft_regs_start + smum_get_offsetof(hwmgr,

drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ static int renoir_od_edit_dpm_table(struct smu_context *smu,
470470
static int renoir_set_fine_grain_gfx_freq_parameters(struct smu_context *smu)
471471
{
472472
uint32_t min = 0, max = 0;
473-
uint32_t ret = 0;
473+
int ret = 0;
474474

475475
ret = smu_cmn_send_smc_msg_with_param(smu,
476476
SMU_MSG_GetMinGfxclkFrequency,

0 commit comments

Comments
 (0)