drm/amdgpu: fix compiler warning
authorNirmoy Das <nirmoy.das@amd.com>
Wed, 17 Jun 2020 11:36:16 +0000 (13:36 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 1 Jul 2020 05:59:22 +0000 (01:59 -0400)
Fixes below warning:
drivers/gpu/drm/amd/amdgpu/df_v3_6.c: In function ‘df_v3_6_reset_perfmon_cntr’:
drivers/gpu/drm/amd/amdgpu/df_v3_6.c:571:2: warning: ‘hi_base_addr’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
  571 |  df_v3_6_perfmon_wreg(adev, lo_base_addr, 0, hi_base_addr, 0);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/df_v3_6.c

index a7b8292..1ab2618 100644 (file)
@@ -560,7 +560,7 @@ static void df_v3_6_pmc_release_cntr(struct amdgpu_device *adev,
 static void df_v3_6_reset_perfmon_cntr(struct amdgpu_device *adev,
                                         uint64_t config)
 {
-       uint32_t lo_base_addr, hi_base_addr;
+       uint32_t lo_base_addr = 0, hi_base_addr = 0;
 
        df_v3_6_pmc_get_read_settings(adev, config, &lo_base_addr,
                                      &hi_base_addr);