lkml.org 
[lkml]   [2015]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] kernel.h: make abs() work with 64-bit types
From
On Wed, Sep 16, 2015 at 5:57 AM, Michal Nazarewicz <mina86@mina86.com> wrote:
> For 64-bit arguments, abs macro casts it to an int which leads to lost
> precision and may cause incorrect results. To deal with 64-bit types
> abs64 macro has been introduced but still there are places where abs
> macro is used incorrectly.
>
> To deal with the problem, expand abs macro such that it operates on s64
> type when dealing with 64-bit types while still returning long when
> dealing with smaller types.
>
> Signed-off-by: Michal Nazarewicz <mina86@mina86.com>

Sorry this is a little late, but I did run this patch through my tests
on a 32bit system (against 4.2, since my localized fix has already
landed in Linus' head) to make sure it resolved the bug I saw and it
did.

So,
Tested-by: John Stultz <john.stultz@linaro.org>

thanks!
-john


\
 
 \ /
  Last update: 2015-09-18 05:21    [W:0.321 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site