Skip to content

Commit 3f36e71

Browse files
qianfengrongalexdeucher
authored andcommitted
drm/radeon/ci_dpm: Use int type to store negative error codes
Change the 'ret' variable in ci_populate_all_graphic_levels() and ci_populate_all_memory_levels() from u32 to int, as it needs to store either 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 086f66e commit 3f36e71

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/gpu/drm/radeon/ci_dpm.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3238,7 +3238,8 @@ static int ci_populate_all_graphic_levels(struct radeon_device *rdev)
32383238
u32 level_array_size = sizeof(SMU7_Discrete_GraphicsLevel) *
32393239
SMU7_MAX_LEVELS_GRAPHICS;
32403240
SMU7_Discrete_GraphicsLevel *levels = pi->smc_state_table.GraphicsLevel;
3241-
u32 i, ret;
3241+
int ret;
3242+
u32 i;
32423243

32433244
memset(levels, 0, level_array_size);
32443245

@@ -3285,7 +3286,8 @@ static int ci_populate_all_memory_levels(struct radeon_device *rdev)
32853286
u32 level_array_size = sizeof(SMU7_Discrete_MemoryLevel) *
32863287
SMU7_MAX_LEVELS_MEMORY;
32873288
SMU7_Discrete_MemoryLevel *levels = pi->smc_state_table.MemoryLevel;
3288-
u32 i, ret;
3289+
int ret;
3290+
u32 i;
32893291

32903292
memset(levels, 0, level_array_size);
32913293

0 commit comments

Comments
 (0)