From 06f805965fc205e27681eee99fd2376fafd8da65 Mon Sep 17 00:00:00 2001 From: Vladimir Murzin Date: Tue, 8 Sep 2015 15:00:16 -0700 Subject: memtest: use kstrtouint instead of simple_strtoul Since simple_strtoul is obsolete and memtest_pattern is type of int, use kstrtouint instead. Signed-off-by: Vladimir Murzin Cc: Leon Romanovsky Acked-by: David Rientjes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- mm/memtest.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'mm/memtest.c') diff --git a/mm/memtest.c b/mm/memtest.c index 0a1cc133f6d7..20e836138e00 100644 --- a/mm/memtest.c +++ b/mm/memtest.c @@ -89,16 +89,18 @@ static void __init do_one_pass(u64 pattern, phys_addr_t start, phys_addr_t end) } /* default is disabled */ -static int memtest_pattern __initdata; +static unsigned int memtest_pattern __initdata; static int __init parse_memtest(char *arg) { + int ret = 0; + if (arg) - memtest_pattern = simple_strtoul(arg, NULL, 0); + ret = kstrtouint(arg, 0, &memtest_pattern); else memtest_pattern = ARRAY_SIZE(patterns); - return 0; + return ret; } early_param("memtest", parse_memtest); -- cgit From f373bafcad68834761b40da9cecda842f43d4797 Mon Sep 17 00:00:00 2001 From: Vladimir Murzin Date: Tue, 8 Sep 2015 15:00:19 -0700 Subject: memtest: cleanup log messages - prefer pr_info(... to printk(KERN_INFO ... - use %pa for phys_addr_t - use cpu_to_be64 while printing pattern in reserve_bad_mem() Signed-off-by: Vladimir Murzin Cc: Leon Romanovsky Acked-by: David Rientjes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- mm/memtest.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'mm/memtest.c') diff --git a/mm/memtest.c b/mm/memtest.c index 20e836138e00..6bcf7d89adfc 100644 --- a/mm/memtest.c +++ b/mm/memtest.c @@ -31,10 +31,8 @@ static u64 patterns[] __initdata = { static void __init reserve_bad_mem(u64 pattern, phys_addr_t start_bad, phys_addr_t end_bad) { - printk(KERN_INFO " %016llx bad mem addr %010llx - %010llx reserved\n", - (unsigned long long) pattern, - (unsigned long long) start_bad, - (unsigned long long) end_bad); + pr_info(" %016llx bad mem addr %pa - %pa reserved\n", + cpu_to_be64(pattern), &start_bad, &end_bad); memblock_reserve(start_bad, end_bad - start_bad); } @@ -79,10 +77,8 @@ static void __init do_one_pass(u64 pattern, phys_addr_t start, phys_addr_t end) this_start = clamp(this_start, start, end); this_end = clamp(this_end, start, end); if (this_start < this_end) { - printk(KERN_INFO " %010llx - %010llx pattern %016llx\n", - (unsigned long long)this_start, - (unsigned long long)this_end, - (unsigned long long)cpu_to_be64(pattern)); + pr_info(" %pa - %pa pattern %016llx\n", + &this_start, &this_end, cpu_to_be64(pattern)); memtest(pattern, this_start, this_end - this_start); } } @@ -113,7 +109,7 @@ void __init early_memtest(phys_addr_t start, phys_addr_t end) if (!memtest_pattern) return; - printk(KERN_INFO "early_memtest: # of tests: %d\n", memtest_pattern); + pr_info("early_memtest: # of tests: %u\n", memtest_pattern); for (i = memtest_pattern-1; i < UINT_MAX; --i) { idx = i % ARRAY_SIZE(patterns); do_one_pass(patterns[idx], start, end); -- cgit From 3115aec4513e5bcb399235cac98a5637fe641c13 Mon Sep 17 00:00:00 2001 From: Vladimir Murzin Date: Tue, 8 Sep 2015 15:00:22 -0700 Subject: memtest: remove unused header files memtest does not require these headers to be included. Signed-off-by: Vladimir Murzin Cc: Leon Romanovsky Acked-by: David Rientjes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- mm/memtest.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'mm/memtest.c') diff --git a/mm/memtest.c b/mm/memtest.c index 6bcf7d89adfc..8eaa4c3a5f65 100644 --- a/mm/memtest.c +++ b/mm/memtest.c @@ -1,11 +1,6 @@ #include -#include -#include #include -#include -#include #include -#include #include static u64 patterns[] __initdata = { -- cgit