[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-c9690998ef48ffefeccb91c70a7739eebdea57f9@git.kernel.org>
Date: Mon, 8 Jun 2009 20:36:34 GMT
From: tip-bot for Andreas Herrmann <andreas.herrmann3@....com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
yinghai@...nel.org, andreas.herrmann3@....com,
akpm@...ux-foundation.org, stable@...nel.org, tglx@...utronix.de,
mingo@...e.hu, penguin-kernel@...ove.sakura.ne.jp
Subject: [tip:x86/urgent] x86: memtest: remove 64-bit division
Commit-ID: c9690998ef48ffefeccb91c70a7739eebdea57f9
Gitweb: http://git.kernel.org/tip/c9690998ef48ffefeccb91c70a7739eebdea57f9
Author: Andreas Herrmann <andreas.herrmann3@....com>
AuthorDate: Mon, 8 Jun 2009 19:09:39 +0200
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Mon, 8 Jun 2009 19:18:25 +0200
x86: memtest: remove 64-bit division
Using gcc 3.3.5 a "make allmodconfig" + "CONFIG_KVM=n"
triggers a build error:
arch/x86/mm/built-in.o(.init.text+0x43f7): In function `__change_page_attr':
arch/x86/mm/pageattr.c:114: undefined reference to `__udivdi3'
make: *** [.tmp_vmlinux1] Error 1
The culprit turned out to be a division in arch/x86/mm/memtest.c
For more info see this thread:
http://marc.info/?l=linux-kernel&m=124416232620683
The patch entirely removes the division that caused the build
error.
[ Impact: build fix with certain GCC versions ]
Reported-by: Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>
Signed-off-by: Andreas Herrmann <andreas.herrmann3@....com>
Cc: Yinghai Lu <yinghai@...nel.org>
Cc: xiyou.wangcong@...il.com
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: <stable@...nel.org>
LKML-Reference: <20090608170939.GB12431@...erich.amd.com>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
arch/x86/mm/memtest.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/x86/mm/memtest.c b/arch/x86/mm/memtest.c
index 605c8be..c0bedcd 100644
--- a/arch/x86/mm/memtest.c
+++ b/arch/x86/mm/memtest.c
@@ -40,23 +40,23 @@ static void __init reserve_bad_mem(u64 pattern, u64 start_bad, u64 end_bad)
static void __init memtest(u64 pattern, u64 start_phys, u64 size)
{
- u64 i, count;
- u64 *start;
+ u64 *p;
+ void *start, *end;
u64 start_bad, last_bad;
u64 start_phys_aligned;
size_t incr;
incr = sizeof(pattern);
start_phys_aligned = ALIGN(start_phys, incr);
- count = (size - (start_phys_aligned - start_phys))/incr;
start = __va(start_phys_aligned);
+ end = start + size - (start_phys_aligned - start_phys);
start_bad = 0;
last_bad = 0;
- for (i = 0; i < count; i++)
- start[i] = pattern;
- for (i = 0; i < count; i++, start++, start_phys_aligned += incr) {
- if (*start == pattern)
+ for (p = start; p < end; p++)
+ *p = pattern;
+ for (p = start; p < end; p++, start_phys_aligned += incr) {
+ if (*p == pattern)
continue;
if (start_phys_aligned == last_bad + incr) {
last_bad += incr;
--
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