* [PATCH -mm] parse_integer: convert fs/exofs/
@ 2015-07-20 22:12 Alexey Dobriyan
0 siblings, 0 replies; only message in thread
From: Alexey Dobriyan @ 2015-07-20 22:12 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel, ooo
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);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-07-20 22:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-20 22:12 [PATCH -mm] parse_integer: convert fs/exofs/ Alexey Dobriyan
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®