提交 3dbb95f7 编写于 作者: J Jingoo Han 提交者: Linus Torvalds

mm: replace strict_strtoul() with kstrtoul()

The use of strict_strtoul() is not preferred, because strict_strtoul() is
obsolete.  Thus, kstrtoul() should be used.
Signed-off-by: NJingoo Han <jg1.han@samsung.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 6df46865
...@@ -417,7 +417,7 @@ static ssize_t scan_sleep_millisecs_store(struct kobject *kobj, ...@@ -417,7 +417,7 @@ static ssize_t scan_sleep_millisecs_store(struct kobject *kobj,
unsigned long msecs; unsigned long msecs;
int err; int err;
err = strict_strtoul(buf, 10, &msecs); err = kstrtoul(buf, 10, &msecs);
if (err || msecs > UINT_MAX) if (err || msecs > UINT_MAX)
return -EINVAL; return -EINVAL;
...@@ -444,7 +444,7 @@ static ssize_t alloc_sleep_millisecs_store(struct kobject *kobj, ...@@ -444,7 +444,7 @@ static ssize_t alloc_sleep_millisecs_store(struct kobject *kobj,
unsigned long msecs; unsigned long msecs;
int err; int err;
err = strict_strtoul(buf, 10, &msecs); err = kstrtoul(buf, 10, &msecs);
if (err || msecs > UINT_MAX) if (err || msecs > UINT_MAX)
return -EINVAL; return -EINVAL;
...@@ -470,7 +470,7 @@ static ssize_t pages_to_scan_store(struct kobject *kobj, ...@@ -470,7 +470,7 @@ static ssize_t pages_to_scan_store(struct kobject *kobj,
int err; int err;
unsigned long pages; unsigned long pages;
err = strict_strtoul(buf, 10, &pages); err = kstrtoul(buf, 10, &pages);
if (err || !pages || pages > UINT_MAX) if (err || !pages || pages > UINT_MAX)
return -EINVAL; return -EINVAL;
...@@ -538,7 +538,7 @@ static ssize_t khugepaged_max_ptes_none_store(struct kobject *kobj, ...@@ -538,7 +538,7 @@ static ssize_t khugepaged_max_ptes_none_store(struct kobject *kobj,
int err; int err;
unsigned long max_ptes_none; unsigned long max_ptes_none;
err = strict_strtoul(buf, 10, &max_ptes_none); err = kstrtoul(buf, 10, &max_ptes_none);
if (err || max_ptes_none > HPAGE_PMD_NR-1) if (err || max_ptes_none > HPAGE_PMD_NR-1)
return -EINVAL; return -EINVAL;
......
...@@ -1526,7 +1526,7 @@ static ssize_t nr_hugepages_store_common(bool obey_mempolicy, ...@@ -1526,7 +1526,7 @@ static ssize_t nr_hugepages_store_common(bool obey_mempolicy,
struct hstate *h; struct hstate *h;
NODEMASK_ALLOC(nodemask_t, nodes_allowed, GFP_KERNEL | __GFP_NORETRY); NODEMASK_ALLOC(nodemask_t, nodes_allowed, GFP_KERNEL | __GFP_NORETRY);
err = strict_strtoul(buf, 10, &count); err = kstrtoul(buf, 10, &count);
if (err) if (err)
goto out; goto out;
...@@ -1617,7 +1617,7 @@ static ssize_t nr_overcommit_hugepages_store(struct kobject *kobj, ...@@ -1617,7 +1617,7 @@ static ssize_t nr_overcommit_hugepages_store(struct kobject *kobj,
if (h->order >= MAX_ORDER) if (h->order >= MAX_ORDER)
return -EINVAL; return -EINVAL;
err = strict_strtoul(buf, 10, &input); err = kstrtoul(buf, 10, &input);
if (err) if (err)
return err; return err;
......
...@@ -1639,7 +1639,7 @@ static ssize_t kmemleak_write(struct file *file, const char __user *user_buf, ...@@ -1639,7 +1639,7 @@ static ssize_t kmemleak_write(struct file *file, const char __user *user_buf,
else if (strncmp(buf, "scan=", 5) == 0) { else if (strncmp(buf, "scan=", 5) == 0) {
unsigned long secs; unsigned long secs;
ret = strict_strtoul(buf + 5, 0, &secs); ret = kstrtoul(buf + 5, 0, &secs);
if (ret < 0) if (ret < 0)
goto out; goto out;
stop_scan_thread(); stop_scan_thread();
......
...@@ -2194,7 +2194,7 @@ static ssize_t sleep_millisecs_store(struct kobject *kobj, ...@@ -2194,7 +2194,7 @@ static ssize_t sleep_millisecs_store(struct kobject *kobj,
unsigned long msecs; unsigned long msecs;
int err; int err;
err = strict_strtoul(buf, 10, &msecs); err = kstrtoul(buf, 10, &msecs);
if (err || msecs > UINT_MAX) if (err || msecs > UINT_MAX)
return -EINVAL; return -EINVAL;
...@@ -2217,7 +2217,7 @@ static ssize_t pages_to_scan_store(struct kobject *kobj, ...@@ -2217,7 +2217,7 @@ static ssize_t pages_to_scan_store(struct kobject *kobj,
int err; int err;
unsigned long nr_pages; unsigned long nr_pages;
err = strict_strtoul(buf, 10, &nr_pages); err = kstrtoul(buf, 10, &nr_pages);
if (err || nr_pages > UINT_MAX) if (err || nr_pages > UINT_MAX)
return -EINVAL; return -EINVAL;
...@@ -2239,7 +2239,7 @@ static ssize_t run_store(struct kobject *kobj, struct kobj_attribute *attr, ...@@ -2239,7 +2239,7 @@ static ssize_t run_store(struct kobject *kobj, struct kobj_attribute *attr,
int err; int err;
unsigned long flags; unsigned long flags;
err = strict_strtoul(buf, 10, &flags); err = kstrtoul(buf, 10, &flags);
if (err || flags > UINT_MAX) if (err || flags > UINT_MAX)
return -EINVAL; return -EINVAL;
if (flags > KSM_RUN_UNMERGE) if (flags > KSM_RUN_UNMERGE)
......
...@@ -4420,7 +4420,7 @@ static ssize_t order_store(struct kmem_cache *s, ...@@ -4420,7 +4420,7 @@ static ssize_t order_store(struct kmem_cache *s,
unsigned long order; unsigned long order;
int err; int err;
err = strict_strtoul(buf, 10, &order); err = kstrtoul(buf, 10, &order);
if (err) if (err)
return err; return err;
...@@ -4448,7 +4448,7 @@ static ssize_t min_partial_store(struct kmem_cache *s, const char *buf, ...@@ -4448,7 +4448,7 @@ static ssize_t min_partial_store(struct kmem_cache *s, const char *buf,
unsigned long min; unsigned long min;
int err; int err;
err = strict_strtoul(buf, 10, &min); err = kstrtoul(buf, 10, &min);
if (err) if (err)
return err; return err;
...@@ -4468,7 +4468,7 @@ static ssize_t cpu_partial_store(struct kmem_cache *s, const char *buf, ...@@ -4468,7 +4468,7 @@ static ssize_t cpu_partial_store(struct kmem_cache *s, const char *buf,
unsigned long objects; unsigned long objects;
int err; int err;
err = strict_strtoul(buf, 10, &objects); err = kstrtoul(buf, 10, &objects);
if (err) if (err)
return err; return err;
if (objects && !kmem_cache_has_cpu_partial(s)) if (objects && !kmem_cache_has_cpu_partial(s))
...@@ -4784,7 +4784,7 @@ static ssize_t remote_node_defrag_ratio_store(struct kmem_cache *s, ...@@ -4784,7 +4784,7 @@ static ssize_t remote_node_defrag_ratio_store(struct kmem_cache *s,
unsigned long ratio; unsigned long ratio;
int err; int err;
err = strict_strtoul(buf, 10, &ratio); err = kstrtoul(buf, 10, &ratio);
if (err) if (err)
return err; return err;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册