drm/amd/pp: initialize result to before or'ing in data
authorColin Ian King <colin.king@canonical.com>
Wed, 6 Jun 2018 12:18:31 +0000 (13:18 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 13 Jun 2018 18:45:22 +0000 (13:45 -0500)
commitc4ff91dd40e2253ab6dd028011469c2c694e1e19
tree096607cd20a37096fa2c42cdfaec6427f1b0aeec
parentc3dade5ef72d9141e28fb86ebd46a9b3f3f4e030
drm/amd/pp: initialize result to before or'ing in data

The current use of result is or'ing in values and checking for
a non-zero result, however, result is not initialized to zero
so it potentially contains garbage to start with. Fix this by
initializing it to the first return from the call to
vega10_program_didt_config_registers.

Detected by cppcheck:
"(error) Uninitialized variable: result"

Fixes: 9b7b8154cdb8 ("drm/amd/powerplay: added didt support for vega10")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Huang Rui <ray.huang@amd.com>
[Fix the subject as Colin's comment]
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c