From: Evan Quan Date: Wed, 28 Oct 2020 02:33:04 +0000 (+0800) Subject: drm/amd/pm: fix compile warnings about variable used uninitialized X-Git-Tag: v5.15~2259^2~12^2~80 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e31ae352b77627666a06342373257d050971956f;p=platform%2Fkernel%2Flinux-starfive.git drm/amd/pm: fix compile warnings about variable used uninitialized Fix the compile warnings below: >> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:1743:13: warning: variable 'min' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] >> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:1743:13: warning: variable 'max' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] Signed-off-by: Evan Quan Reported-by: kernel test robot Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c index 0b9083c..53111c6 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c @@ -1866,7 +1866,7 @@ static int smu7_calculate_ro_range(struct pp_hwmgr *hwmgr) { struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); struct amdgpu_device *adev = hwmgr->adev; - uint32_t asicrev1, evv_revision, max, min; + uint32_t asicrev1, evv_revision, max = 0, min = 0; atomctrl_read_efuse(hwmgr, STRAP_EVV_REVISION_LSB, STRAP_EVV_REVISION_MSB, &evv_revision); @@ -1903,8 +1903,7 @@ static int smu7_calculate_ro_range(struct pp_hwmgr *hwmgr) max = 2500; } } - } else if ((hwmgr->chip_id == CHIP_POLARIS11) || - (hwmgr->chip_id == CHIP_POLARIS12)) { + } else { min = 1100; max = 2100; }