Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1225591

Re: [RFC][PATCH 0/5] Fixes for abs() usage on 64bit values

From Linus Torvalds <torvalds@linux-foundation.org>
Newsgroups linux.kernel
Subject Re: [RFC][PATCH 0/5] Fixes for abs() usage on 64bit values
Date 2015-09-16 01:50 +0200
Message-ID <q9894-40S-5@gated-at.bofh.it> (permalink)
References <q8MUV-6nq-5@gated-at.bofh.it> <q8NHj-7hi-3@gated-at.bofh.it> <q8P6q-136-7@gated-at.bofh.it> <q8QYy-3JQ-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[RFC][PATCH 0/5] Fixes for abs() usage on 64bit values John Stultz <john.stultz@linaro.org> - 2015-09-15 03:10 +0200
  [RFC][PATCH 1/5] clocksource: Fix abs() usage w/ 64bit values John Stultz <john.stultz@linaro.org> - 2015-09-15 03:10 +0200
  [RFC][PATCH 2/5] time: Fix abs() usage with 64-bit values. John Stultz <john.stultz@linaro.org> - 2015-09-15 03:10 +0200
  Re: [RFC][PATCH 0/5] Fixes for abs() usage on 64bit values Tejun Heo <tj@kernel.org> - 2015-09-15 04:00 +0200
    Re: [RFC][PATCH 0/5] Fixes for abs() usage on 64bit values John Stultz <john.stultz@linaro.org> - 2015-09-15 05:30 +0200
      Re: [RFC][PATCH 0/5] Fixes for abs() usage on 64bit values Tejun Heo <tj@kernel.org> - 2015-09-15 05:50 +0200
        Re: [RFC][PATCH 0/5] Fixes for abs() usage on 64bit values Jeff Epler <jepler@unpythonic.net> - 2015-09-15 14:50 +0200
        Re: [RFC][PATCH 0/5] Fixes for abs() usage on 64bit values Andrew Morton <akpm@linux-foundation.org> - 2015-09-15 23:30 +0200
          Re: [RFC][PATCH 0/5] Fixes for abs() usage on 64bit values Michal Nazarewicz <mina86@mina86.com> - 2015-09-16 01:00 +0200
      Re: [RFC][PATCH 0/5] Fixes for abs() usage on 64bit values Ingo Molnar <mingo@kernel.org> - 2015-09-15 07:30 +0200
        Re: [RFC][PATCH 0/5] Fixes for abs() usage on 64bit values Linus Torvalds <torvalds@linux-foundation.org> - 2015-09-16 01:50 +0200

csiph-web