]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
drm/amd/powerplay: precedence bug in init_non_clock_fields()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 4 Jan 2016 20:44:24 +0000 (23:44 +0300)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 4 Jan 2016 21:21:44 +0000 (16:21 -0500)
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 <dan.carpenter@oracle.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c

index 1d385f473776e53297989514be17ea78a179b025..8f9d705bbde229e560484e4bdf71c1b7c91ba702 100644 (file)
@@ -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;