From: Alexey Dobriyan <adobriyan@gmail.com>
To: akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, ooo@electrozaur.com
Subject: [PATCH -mm] parse_integer: convert fs/exofs/
Date: Tue, 21 Jul 2015 01:12:26 +0300 [thread overview]
Message-ID: <20150720221226.GB8907@p183.telecom.by> (raw)
Convert deprecated simple_strtoull() usage.
Copying option string is unnecessary as you can parse directly
from the original string.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---
fs/exofs/super.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
--- a/fs/exofs/super.c
+++ b/fs/exofs/super.c
@@ -84,6 +84,7 @@ static int parse_options(char *options, struct exofs_mountopt *opts)
substring_t args[MAX_OPT_ARGS];
int option;
bool s_pid = false;
+ int rv;
EXOFS_DBGMSG("parse_options %s\n", options);
/* defaults */
@@ -92,7 +93,6 @@ static int parse_options(char *options, struct exofs_mountopt *opts)
while ((p = strsep(&options, ",")) != NULL) {
int token;
- char str[32];
if (!*p)
continue;
@@ -108,9 +108,11 @@ static int parse_options(char *options, struct exofs_mountopt *opts)
opts->is_osdname = true;
break;
case Opt_pid:
- if (0 == match_strlcpy(str, &args[0], sizeof(str)))
+ rv = parse_integer(args[0].from, 0, &opts->pid);
+ if (rv < 0)
+ return rv;
+ if (args[0].from[rv] != '\0')
return -EINVAL;
- opts->pid = simple_strtoull(str, NULL, 0);
if (opts->pid < EXOFS_MIN_PID) {
EXOFS_ERR("Partition ID must be >= %u",
EXOFS_MIN_PID);
reply other threads:[~2015-07-20 22:12 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20150720221226.GB8907@p183.telecom.by \
--to=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ooo@electrozaur.com \
/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
all inboxes | Powered by JetHome®