lkml.org 
[lkml]   [2015]   [Sep]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC][PATCH 0/5] Fixes for abs() usage on 64bit values
From
On Mon, Sep 14, 2015 at 10:20 PM, Ingo Molnar <mingo@kernel.org> wrote:
>
> Linus, any preferences?

I like the "auto-expand to 64-bit when necessary", but yes, that thing
needs to continue to use a signed type. Using __builtin_choose_expr()
would seem to be the right thing to do (not Andrew's version that
makes the return type be s64 unconditionally).

Just a quick grep shows that we currently use "abs()" on unsigned long
and we expect it to be a signed comparison with zero, so the "simple"
typeof that John suggested definitely will not work.

Linus


\
 
 \ /
  Last update: 2015-09-16 02:01    [W:0.126 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site