Skip to content

Commit 10c69a0

Browse files
committed
9p v9fs_parse_options: replace simple_strtoul with kstrtouint
This is also a checkpatch change, but this one might have more implications so keeping this separate Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Dominique Martinet <[email protected]>
1 parent 024b7d6 commit 10c69a0

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

fs/9p/v9fs.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
164164
substring_t args[MAX_OPT_ARGS];
165165
char *p;
166166
int option = 0;
167-
char *s, *e;
167+
char *s;
168168
int ret = 0;
169169

170170
/* setup defaults */
@@ -319,12 +319,13 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
319319
v9ses->flags |= V9FS_ACCESS_CLIENT;
320320
} else {
321321
uid_t uid;
322+
322323
v9ses->flags |= V9FS_ACCESS_SINGLE;
323-
uid = simple_strtoul(s, &e, 10);
324-
if (*e != '\0') {
325-
ret = -EINVAL;
326-
pr_info("Unknown access argument %s\n",
327-
s);
324+
r = kstrtouint(s, 10, &uid);
325+
if (r) {
326+
ret = r;
327+
pr_info("Unknown access argument %s: %d\n",
328+
s, r);
328329
kfree(s);
329330
continue;
330331
}

0 commit comments

Comments
 (0)