summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2014-06-05 01:12:21 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-05 01:54:21 +0200
commit8091b895b76f690aa2f6689b6ed602f07525a938 (patch)
tree8885f760435f5c4b63636069a7b77a63130764ba /fs
parentinit/main.c: remove an ifdef (diff)
downloadlinux-8091b895b76f690aa2f6689b6ed602f07525a938.tar.xz
linux-8091b895b76f690aa2f6689b6ed602f07525a938.zip
fs/ncpfs/getopt.c: replace simple_strtoul by kstrtoul
Remove obsolete simple_strtoul in ncp_getopt Signed-off-by: Fabian Frederick <fabf@skynet.be> Cc: Petr Vandrovec <petr@vandrovec.name> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/ncpfs/getopt.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/ncpfs/getopt.c b/fs/ncpfs/getopt.c
index 03ffde1f44d6..344889cd120e 100644
--- a/fs/ncpfs/getopt.c
+++ b/fs/ncpfs/getopt.c
@@ -53,15 +53,14 @@ int ncp_getopt(const char *caller, char **options, const struct ncp_option *opts
return -EINVAL;
}
if (opts->has_arg & OPT_INT) {
- char* v;
+ int rc = kstrtoul(val, 0, value);
- *value = simple_strtoul(val, &v, 0);
- if (!*v) {
- return opts->val;
+ if (rc) {
+ pr_info("%s: invalid numeric value in %s=%s\n",
+ caller, token, val);
+ return rc;
}
- pr_info("%s: invalid numeric value in %s=%s\n",
- caller, token, val);
- return -EDOM;
+ return opts->val;
}
if (opts->has_arg & OPT_STRING) {
return opts->val;