lkml.org 
[lkml]   [2016]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] drm: powerplay: use div64_s64 instead of do_div
On Fri, Jan 01, 2016 at 02:07:41PM +0100, Arnd Bergmann wrote:
> The newly added code for Fiji creates a correct compiler warning
> about invalid use of the do_div macro:
>
> In file included from powerplay/hwmgr/ppatomctrl.c:31:0:
> drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppevvmath.h: In function 'fDivide':
> drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppevvmath.h:382:89: warning: comparison of distinct pointer types lacks a cast
> do_div(longlongX, longlongY); /*Q(32,32) divided by Q(16,16) = Q(16,16) Back to original format */
>
> do_div() divides an unsigned 64-bit number by an unsigned 32-bit number.
> The code instead wants to divide two signed 64-bit numbers, which is done
> using the div64_s64 function.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 770911a3cfbb ("drm/amd/powerplay: add/update headers for Fiji SMU and DPM")
> ---
> Found on ARM allmodconfig on yesterday's linux-next

Reviewed-by: Thierry Reding <treding@nvidia.com>
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2016-01-04 10:01    [W:0.072 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site