simple_strtoul() is obselete now, so using newer function kstrtoul()

Signed-off-by: Manjeet Pawar <manjee...@samsung.com>
Signed-off-by: Vinay Kumar Rijhwani <v.rijhw...@samsung.com>
Signed-off-by: Rohit Thapliyal <r.thapli...@samsung.com>
---
 mm/page_alloc.c |  3 +--
 mm/shmem.c      | 11 +++++------
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 77e4d3c..f9d812e 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -7197,9 +7197,8 @@ int percpu_pagelist_fraction_sysctl_handler(struct 
ctl_table *table, int write,
 
 static int __init set_hashdist(char *str)
 {
-       if (!str)
+       if (!str || kstrtoul(str, 0, (unsigned long *)&hashdist))
                return 0;
-       hashdist = simple_strtoul(str, &str, 0);
        return 1;
 }
 __setup("hashdist=", set_hashdist);
diff --git a/mm/shmem.c b/mm/shmem.c
index 07a1d22..bf7d905 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -3470,6 +3470,7 @@ static int shmem_parse_options(char *options, struct 
shmem_sb_info *sbinfo,
        struct mempolicy *mpol = NULL;
        uid_t uid;
        gid_t gid;
+       unsigned long mode;
 
        while (options != NULL) {
                this_char = options;
@@ -3522,14 +3523,13 @@ static int shmem_parse_options(char *options, struct 
shmem_sb_info *sbinfo,
                } else if (!strcmp(this_char,"mode")) {
                        if (remount)
                                continue;
-                       sbinfo->mode = simple_strtoul(value, &rest, 8) & 07777;
-                       if (*rest)
+                       if (kstrtoul(value, 8, &mode))
                                goto bad_val;
+                       sbinfo->mode = mode & 07777;
                } else if (!strcmp(this_char,"uid")) {
                        if (remount)
                                continue;
-                       uid = simple_strtoul(value, &rest, 0);
-                       if (*rest)
+                       if (kstrtoul(value, 0, (unsigned long *)&uid))
                                goto bad_val;
                        sbinfo->uid = make_kuid(current_user_ns(), uid);
                        if (!uid_valid(sbinfo->uid))
@@ -3537,8 +3537,7 @@ static int shmem_parse_options(char *options, struct 
shmem_sb_info *sbinfo,
                } else if (!strcmp(this_char,"gid")) {
                        if (remount)
                                continue;
-                       gid = simple_strtoul(value, &rest, 0);
-                       if (*rest)
+                       if (kstrtoul(value, 0, (unsigned long *)&gid))
                                goto bad_val;
                        sbinfo->gid = make_kgid(current_user_ns(), gid);
                        if (!gid_valid(sbinfo->gid))
-- 
1.9.1

Reply via email to