Alex Waterman ee9d9b0cd2 gpu: nvgpu: Cast unsigned arith to signed for abs()
Before passing in an unsigned value to abs() cast the result
of the subtraction to signed.

In Linux this happens automatically but on non-Linux platforms
abs() does not necessarily do this. clang flags this case as
a pointless operation: abs(x) obviously must equal x for any
unsigned x.

This change should hopefully preserve the Linux behavior but
avoid the compiler warning from clang.

JIRA NVGPU-525

Change-Id: I71320964c0922f1e4890c8b25d801f17e54ed3c0
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1724093
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Aleksandr Frid <afrid@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-05-24 04:37:48 -07:00
2016-05-10 14:37:53 -07:00
Description
No description provided
42 MiB