[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20150720221226.GB8907@p183.telecom.by>
Date: Tue, 21 Jul 2015 01:12:26 +0300
From: Alexey Dobriyan <adobriyan@...il.com>
To: akpm@...ux-foundation.org
Cc: linux-kernel@...r.kernel.org, ooo@...ctrozaur.com
Subject: [PATCH -mm] parse_integer: convert fs/exofs/
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@...il.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);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists