[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1442279124-7309-1-git-send-email-john.stultz@linaro.org>
Date: Mon, 14 Sep 2015 18:05:19 -0700
From: John Stultz <john.stultz@...aro.org>
To: LKML <linux-kernel@...r.kernel.org>
Cc: John Stultz <john.stultz@...aro.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Ingo Molnar <mingo@...nel.org>,
"Steven Rostedt (Red Hat)" <rostedt@...dmis.org>,
Peter Zijlstra <peterz@...radead.org>,
Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
Michal Nazarewicz <mina86@...a86.com>,
Prarit Bhargava <prarit@...hat.com>,
Richard Cochran <richardcochran@...il.com>,
Thomas Gleixner <tglx@...utronix.de>,
"Theodore Ts'o" <tytso@....edu>,
Andreas Dilger <adilger.kernel@...ger.ca>,
Dave Chinner <dchinner@...hat.com>, Tejun Heo <tj@...nel.org>,
Joe Perches <joe@...ches.com>
Subject: [RFC][PATCH 0/5] Fixes for abs() usage on 64bit values
As noted in include/linux/kernel.h:
"abs() should not be used for 64-bit types (s64, u64, long long)
- use abs64() for those."
Unfortunately, there are quite a number of places where abs()
was used w/ 64bit values in the kernel, and the results are
then silently capped to 32-bit values on 32-bit systems.
This series tries to address the problematic sites I found,
and then introduces a patch which modifies abs() so that the
build will fail if a 64-bit type is passed to it on a 32-bit
machine.
I'm sure there are additional sites that will need fixing,
but hopefully this will make them easy to find.
Comments and feedback would be greatly appreciated!
Thanks
-john
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Ingo Molnar <mingo@...nel.org>
Cc: "Steven Rostedt (Red Hat)" <rostedt@...dmis.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
Cc: Michal Nazarewicz <mina86@...a86.com>
Cc: Prarit Bhargava <prarit@...hat.com>
Cc: Richard Cochran <richardcochran@...il.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: "Theodore Ts'o" <tytso@....edu>
Cc: Andreas Dilger <adilger.kernel@...ger.ca>
Cc: Dave Chinner <dchinner@...hat.com>
Cc: Tejun Heo <tj@...nel.org>
Cc: Joe Perches <joe@...ches.com>
John Stultz (5):
clocksource: Fix abs() usage w/ 64bit values
time: Fix abs() usage with 64-bit values.
ext4: Fix abs() usage in ext4_mb_check_group_pa
percpu: Fix abs() usage in percpu_counter_compare()
abs(): Provide build error on passing 64bit value to abs()
fs/ext4/mballoc.c | 4 ++--
include/linux/kernel.h | 3 +++
kernel/time/clocksource.c | 2 +-
kernel/time/timekeeping.c | 2 +-
lib/percpu_counter.c | 2 +-
5 files changed, 8 insertions(+), 5 deletions(-)
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists