drm/amd/display: Fix 64-bit division
authorHarry Wentland <harry.wentland@amd.com>
Mon, 6 Feb 2017 16:23:20 +0000 (11:23 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Sep 2017 21:13:23 +0000 (17:13 -0400)
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dce/dce_abm.c

index f4696bf14a7019826964556414507f3e3bf89311..7005ebb28d4611c8e7d401463f3353bdd8159535 100644 (file)
@@ -94,7 +94,7 @@ static unsigned int get_current_backlight(struct dce_abm *abm_dce)
        if (bl_period == 0)
                bl_period = 0xFFFF;
 
-       current_backlight /= bl_period;
+       current_backlight = div_u64(current_backlight, bl_period);
        current_backlight = (current_backlight + 1) >> 1;
 
        current_backlight = (uint64_t)(current_backlight) * bl_period;