aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-11 14:26:56 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-11 14:26:56 -0400
commit7702667bb490573c807fa45519378e84b5050d1d (patch)
tree912724d7108fab9ecf91cc372f24c58c1f304026
parentb415c49a864dab8ee90713833d642dd461eccae9 (diff)
parent9866b7e86a2ce4daa677be750e3ccbfc65d187f5 (diff)
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: x86: memtest: use pointers of equal type for comparison
-rw-r--r--arch/x86/mm/memtest.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/x86/mm/memtest.c b/arch/x86/mm/memtest.c
index c0bedcd10f97..18d244f70205 100644
--- a/arch/x86/mm/memtest.c
+++ b/arch/x86/mm/memtest.c
@@ -40,21 +40,20 @@ static void __init reserve_bad_mem(u64 pattern, u64 start_bad, u64 end_bad)
40 40
41static void __init memtest(u64 pattern, u64 start_phys, u64 size) 41static void __init memtest(u64 pattern, u64 start_phys, u64 size)
42{ 42{
43 u64 *p; 43 u64 *p, *start, *end;
44 void *start, *end;
45 u64 start_bad, last_bad; 44 u64 start_bad, last_bad;
46 u64 start_phys_aligned; 45 u64 start_phys_aligned;
47 size_t incr; 46 const size_t incr = sizeof(pattern);
48 47
49 incr = sizeof(pattern);
50 start_phys_aligned = ALIGN(start_phys, incr); 48 start_phys_aligned = ALIGN(start_phys, incr);
51 start = __va(start_phys_aligned); 49 start = __va(start_phys_aligned);
52 end = start + size - (start_phys_aligned - start_phys); 50 end = start + (size - (start_phys_aligned - start_phys)) / incr;
53 start_bad = 0; 51 start_bad = 0;
54 last_bad = 0; 52 last_bad = 0;
55 53
56 for (p = start; p < end; p++) 54 for (p = start; p < end; p++)
57 *p = pattern; 55 *p = pattern;
56
58 for (p = start; p < end; p++, start_phys_aligned += incr) { 57 for (p = start; p < end; p++, start_phys_aligned += incr) {
59 if (*p == pattern) 58 if (*p == pattern)
60 continue; 59 continue;