linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Manjeet Pawar <manjeet.p@samsung.com>
To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, vbabka@suse.cz,
	mhocko@suse.com, akpm@linux-foundation.org, hughd@google.com
Cc: a.sahrawat@samsung.com, pankaj.m@samsung.com,
	lalit.mohan@samsung.com, Manjeet Pawar <manjeet.p@samsung.com>,
	Vinay Kumar Rijhwani <v.rijhwani@samsung.com>,
	Rohit Thapliyal <r.thapliyal@samsung.com>
Subject: [PATCH] mm: Replace-simple_strtoul-with-kstrtoul
Date: Thu,  9 Nov 2017 16:58:18 +0530	[thread overview]
Message-ID: <1510226898-4310-1-git-send-email-manjeet.p@samsung.com> (raw)
In-Reply-To: CGME20171109113212epcas5p4b93d4830869468901f4003bde11e3d16@epcas5p4.samsung.com

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

Signed-off-by: Manjeet Pawar <manjeet.p@samsung.com>
Signed-off-by: Vinay Kumar Rijhwani <v.rijhwani@samsung.com>
Signed-off-by: Rohit Thapliyal <r.thapliyal@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	other threads:[~2017-11-09 11:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20171109113212epcas5p4b93d4830869468901f4003bde11e3d16@epcas5p4.samsung.com>
2017-11-09 11:28 ` Manjeet Pawar [this message]
2017-11-09 13:04   ` [PATCH] mm: Replace-simple_strtoul-with-kstrtoul Matthew Wilcox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1510226898-4310-1-git-send-email-manjeet.p@samsung.com \
    --to=manjeet.p@samsung.com \
    --cc=a.sahrawat@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=lalit.mohan@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=pankaj.m@samsung.com \
    --cc=r.thapliyal@samsung.com \
    --cc=v.rijhwani@samsung.com \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).