[PATCH 2/2] drm/amd/amdgpu: Fix maybe-uninitialized warning in df_v3_6_pmc_start

Bhawanpreet Lakha Bhawanpreet.Lakha at amd.com
Wed May 15 20:24:13 UTC 2019


This fixes the warning below

error: ‘ret’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  int xgmi_tx_link, ret;
                    ^~~
Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/df_v3_6.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/df_v3_6.c b/drivers/gpu/drm/amd/amdgpu/df_v3_6.c
index 201c00411720..a8442508eea5 100644
--- a/drivers/gpu/drm/amd/amdgpu/df_v3_6.c
+++ b/drivers/gpu/drm/amd/amdgpu/df_v3_6.c
@@ -459,7 +459,7 @@ static int df_v3_6_stop_xgmi_link_cntr(struct amdgpu_device *adev,
 static int df_v3_6_pmc_start(struct amdgpu_device *adev, uint64_t config,
 			     int is_enable)
 {
-	int xgmi_tx_link, ret;
+	int xgmi_tx_link, ret = 0;
 
 	switch (adev->asic_type) {
 	case CHIP_VEGA20:
-- 
2.17.1



More information about the amd-gfx mailing list