mm/mem-hotplug: replace simple_strtoull() with kstrtoull()
authorZhang Zhen <zhenzhang.zhang@huawei.com>
Wed, 6 Aug 2014 23:06:06 +0000 (16:06 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 7 Aug 2014 01:01:18 +0000 (18:01 -0700)
Use the newer and more pleasant kstrtoull() to replace
simple_strtoull(), because simple_strtoull() is marked for obsoletion.

Signed-off-by: Zhang Zhen <zhenzhang.zhang@huawei.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/base/memory.c

index 7c60ed2..a2e13e2 100644 (file)
@@ -406,7 +406,9 @@ memory_probe_store(struct device *dev, struct device_attribute *attr,
        int i, ret;
        unsigned long pages_per_block = PAGES_PER_SECTION * sections_per_block;
 
-       phys_addr = simple_strtoull(buf, NULL, 0);
+       ret = kstrtoull(buf, 0, &phys_addr);
+       if (ret)
+               return ret;
 
        if (phys_addr & ((pages_per_block << PAGE_SHIFT) - 1))
                return -EINVAL;