Messages in this thread | | | Date | Tue, 15 Sep 2015 16:43:15 -0700 | Subject | Re: [RFC][PATCH 0/5] Fixes for abs() usage on 64bit values | From | Linus Torvalds <> |
| |
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
| |