From: Dan Carpenter Date: Mon, 4 Jan 2016 20:44:24 +0000 (+0300) Subject: drm/amd/powerplay: precedence bug in init_non_clock_fields() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7c9574f262a25c7ca0779df31098ba4e0c382e86;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git drm/amd/powerplay: precedence bug in init_non_clock_fields() The cast to uint8_t happens before the right shift so this always sets .m3arb to zero. The cast is actually a no-op so we can remove it. Fixes: 3bace3591493 ('drm/amd/powerplay: add hardware manager sub-component') Signed-off-by: Dan Carpenter Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c b/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c index 1d385f473776..8f9d705bbde2 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c @@ -735,8 +735,8 @@ static int init_non_clock_fields(struct pp_hwmgr *hwmgr, ps->memory.dllOff = (0 != tmp); - ps->memory.m3arb = (uint8_t)(le32_to_cpu(pnon_clock_info->ulCapsAndSettings) & - ATOM_PPLIB_M3ARB_MASK) >> ATOM_PPLIB_M3ARB_SHIFT; + ps->memory.m3arb = (le32_to_cpu(pnon_clock_info->ulCapsAndSettings) & + ATOM_PPLIB_M3ARB_MASK) >> ATOM_PPLIB_M3ARB_SHIFT; ps->temperatures.min = PP_TEMPERATURE_UNITS_PER_CENTIGRADES * pnon_clock_info->ucMinTemperature;