summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2009-06-11 16:25:01 +0200
committerThomas Gleixner <tglx@linutronix.de>2009-06-11 16:26:35 +0200
commit9866b7e86a2ce4daa677be750e3ccbfc65d187f5 (patch)
tree29a1011829b78a88b1aa1c42fb263e623377e1f3 /arch
parent991ec02cdca33b03a132a0cacfe6f0aa0be9aa8d (diff)
x86: memtest: use pointers of equal type for comparison
Commit c9690998ef48ffefeccb91c70a7739eebdea57f9 (x86: memtest: remove 64-bit division) introduced following compile warning: arch/x86/mm/memtest.c: In function 'memtest': arch/x86/mm/memtest.c:56: warning: comparison of distinct pointer types lacks a cast arch/x86/mm/memtest.c:58: warning: comparison of distinct pointer types lacks a cast Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch')
-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 c0bedcd10f9..18d244f7020 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)
static void __init memtest(u64 pattern, u64 start_phys, u64 size)
{
- u64 *p;
- void *start, *end;
+ u64 *p, *start, *end;
u64 start_bad, last_bad;
u64 start_phys_aligned;
- size_t incr;
+ const size_t incr = sizeof(pattern);
- incr = sizeof(pattern);
start_phys_aligned = ALIGN(start_phys, incr);
start = __va(start_phys_aligned);
- end = start + size - (start_phys_aligned - start_phys);
+ end = start + (size - (start_phys_aligned - start_phys)) / incr;
start_bad = 0;
last_bad = 0;
for (p = start; p < end; p++)
*p = pattern;
+
for (p = start; p < end; p++, start_phys_aligned += incr) {
if (*p == pattern)
continue;