From 1b9557fcaa42a45920821b0c6455088bb341f477 Mon Sep 17 00:00:00 2001 From: Bhawanpreet Lakha Date: Wed, 15 May 2019 16:17:05 -0400 Subject: [PATCH] drm/amd/powerplay: Fix maybe-uninitialized in get_ppfeature_status MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This fixes the warning below error: ‘feature_mask’ may be used uninitialized in this function [-Werror=maybe-uninitialized] *features_enabled = ((((uint64_t)feature_mask[0] << SMU_FEATURES_LOW_SHIFT) & SMU_FEATURES_LOW_MASK) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ (((uint64_t)feature_mask[1] << SMU_FEATURES_HIGH_SHIFT) & SMU_FEATURES_HIGH_MASK)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Reviewed-by: Alex Deucher Signed-off-by: Bhawanpreet Lakha Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c index b39f3d4..4aa8f5a 100644 --- a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c +++ b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c @@ -2377,7 +2377,7 @@ static int vega20_odn_edit_dpm_table(struct smu_context *smu, static int vega20_get_enabled_smc_features(struct smu_context *smu, uint64_t *features_enabled) { - uint32_t feature_mask[2]; + uint32_t feature_mask[2] = {0, 0}; int ret = 0; ret = smu_feature_get_enabled_mask(smu, feature_mask, 2); -- 2.7.4